生成SHA1签名

@return string
336857
public function getSHA1()
    {
        try {
            $array = func_get_args();
            sort($array, SORT_STRING);

            return sha1(implode($array));
        } catch (Exception $e) {
            throw new Exception($e->getMessage(), self::ERROR_CALC_SIGNATURE);
        }
    }
119611
public function getCacheKey(): string
    {
        return $this->getTypePrefix() . $this->getFlexType() . '.' . sha1(json_encode($this->call('getKey')));
    }
851355
public function getHash()
    {
        $hashes = array();

        foreach ($this->getPatches() as $patch) {
            $hashes[] = $patch->getHash();
        }
        sort($hashes);

        return sha1(implode(' ', $hashes));
    }
17712
public function get_sha1() {
        if ($this->multifiles) {
            return sha1(serialize($this->entry) . $this->get_sha1_file());
        }
        return sha1(serialize($this->entry));
    }
93176
private function genCrfsToken()
    {
        $hashOrig = '';
        if (!empty($this->fields)) {
            foreach (array_keys($this->fields) as $field) {
                if ($field !== self::SEPARATOR) {
                    $hashOrig .= $field;
                }
            }
        }
        if ('' !== $hashOrig) {
            $this->crfs = sha1($hashOrig);
            $this->add($this->getName() . '_token', array(
                'type' => 'hidden',
                'value' => $this->crfs,
            ));
        }
        return $this;
    }
314879
protected function generateChecksumForPage()
    {
        return sha1(
                sprintf("%s|%s|%s|%s|%s|%s|%s|%s", $this->_secretCode, $this->data->merchant, $this->data->status, $this->data->statusCode, $this->data->orderID, $this->data->paymentID, $this->data->reference, $this->data->transactionID
                )
        );
    }
727890
private function _generateUniqueId()
    {
        $rand = uniqid(rand(10, 99));
        $time = microtime(true);
        $micro = sprintf('%06d', ($time - floor($time)) * 1000000);
        $date = new DateTime(date('Y-m-d H:i:s.' . $micro, $time));
        return sha1($date->format('YmdHisu'));
    }
173244
public function getSecret()
    {
        if ($this->secret === null)
        {
            $salt = $this->_createSalt(12);
            $name = session_name();

            $this->secret = sha1($salt . $name);
        }

        return $this->secret;
    }
985587
def sha1(filename):
    """"""
    filename = unmap_file(filename)
    if filename not in file_cache:
        cache_file(filename)
        if filename not in file_cache:
            return None
        pass
    if file_cache[filename].sha1:
        return file_cache[filename].sha1.hexdigest()
    sha1 = hashlib.sha1()
    for line in file_cache[filename].lines['plain']:
        sha1.update(line.encode('utf-8'))
        pass
    file_cache[filename].sha1 = sha1
    return sha1.hexdigest()
909938
protected function generateSignature()
    {
        $signature  = $this->getMerchantPassword();
        $signature .= $this->getMerchantId();
        $signature .= $this->getAcquirerId();
        $signature .= $this->getTransactionId();
        $signature .= $this->formatAmount();
        $signature .= $this->getCurrencyNumeric();

        return base64_encode( sha1($signature, true) );
    }
97920
public function challengeHash()
    {
        return substr(pack('H*',hash('sha1', $this->peerChallenge . $this->authChallenge . $this->username)), 0, 8);
    }
117962
protected function getHash()
    {
        $query  = $this->getSQL();
        $hints  = $this->getHints();
        $params = array_map(function(Parameter $parameter) {
            // Small optimization
            // Does not invoke processParameterValue for scalar values
            if (is_scalar($value = $parameter->getValue())) {
                return $value;
            }

            return $this->processParameterValue($value);
        }, $this->parameters->getValues());

        ksort($hints);

        return sha1($query . '-' . serialize($params) . '-' . serialize($hints));
    }
958114
public function getId()
    {
        // keys to ignore in the hashing process
        $ignoreKeys = ['quantity'];

        // data to use for the hashing process
        $hashData = $this->data;
        foreach ($ignoreKeys as $key) {
            unset($hashData[$key]);
        }

        $hash = sha1(serialize($hashData));

        return $hash;
    }
707163
public function getCacheKey(): string
    {
        return $this->getTypePrefix() . $this->getFlexType() . '.' . sha1(json_encode($this->getKeys()) . $this->_keyField);
    }
1144638
public function generate(): string
    {
        $this->token = hash('sha256', $this->generateRandomToken());
        $this->session[$this->name] = $this->token;

        return $this->token;
    }
612551
protected function getDataVersionHash()
    {
        $filter = $this->getPropertyFilter();
        $properties = $filter->getProperties();
        sort($properties);
        
        return sha1(
            static::class . '|' .
            static::VERSION . '|' .
            get_class($filter) . '|' .
            implode(',', $properties)
        );
    }
1178711
public function get_sha1_file() {
        if (empty($this->singlefile) && empty($this->multifiles)) {
            throw new portfolio_caller_exception('invalidsha1file', 'portfolio', $this->get_return_url());
        }
        if ($this->singlefile) {
            return $this->singlefile->get_contenthash();
        }
        $sha1s = array();
        foreach ($this->multifiles as $file) {
            $sha1s[] = $file->get_contenthash();
        }
        asort($sha1s);
        return sha1(implode('', $sha1s));
    }