Composes the auth string needed for the newer versions of the API

@param $hashString

@return string
975284
protected function buildAuthString($hashString)
    {
        return sprintf(
            'GGE4_API %s:%s',
            $this->getKeyId(),
            base64_encode(hash_hmac("sha1", $hashString, $this->getHmac(), true))
        );
    }
476456
private function prepareStepString($keywordsString)
    {
        if (0 === mb_strpos($keywordsString, '*|', 0, 'UTF-8')) {
            $keywordsString = mb_substr($keywordsString, 2, mb_strlen($keywordsString, 'utf8') - 2, 'utf8');
        }

        return $keywordsString;
    }
731127
function setHashEncoding($hashAlgorithm)
    {
        $hashAlgorithm = strtolower($hashAlgorithm);
        if ($hashAlgorithm != 'md5' && $hashAlgorithm != 'sha1') {
            throw new InvalidArgumentException("Invalid hash algorithim: '$hashAlgorithm'.");
        }

        $this->manifest->setHashEncoding($hashAlgorithm);
        if ($this->tagManifest !== null) {
            $this->tagManifest->setHashEncoding($hashAlgorithm);
        }
    }
780274
public function setHashString(string $string)
    {
        if (!empty(trim($string))) {
            $this->string = $string;
            $this->hash = md5($string);
            $this->convertHashToArrayOfBoolean();

            return $this;
        }
    }
262130
public function encodeHashOfString($string)
    {

        $salt = $this->getServiceContainer()->getParameter('secret');

        $key = substr(base64_encode($salt), 0, 30);

        $options = array(
            'cost' => 13,
            'salt' => $key
        );

        $hash = hash('sha512', password_hash($string, PASSWORD_BCRYPT, $options));

        return $hash;
    }
1065421
public function signRequest( $sRequestString )
    {
        $hPrivateKey = openssl_get_privatekey(
            oxRegistry::get( 'OxpsPaymorrowSettings' )->getPrivateKey()
        );

        openssl_sign( $sRequestString, $bSignature, $hPrivateKey );

        return bin2hex( $bSignature );
    }
1170092
function hash($text)
    {
        $mode = is_array($this->hash) ? self::MODE_INTERNAL : CRYPT_HASH_MODE;

        if (!empty($this->key) || is_string($this->key)) {
            switch ($mode) {
                case self::MODE_MHASH:
                    $output = mhash($this->hash, $text, $this->key);
                    break;
                case self::MODE_HASH:
                    $output = hash_hmac($this->hash, $text, $this->key, true);
                    break;
                case self::MODE_INTERNAL:
                    /* "Applications that use keys longer than B bytes will first hash the key using H and then use the
                        resultant L byte string as the actual key to HMAC."

                        -- http://tools.ietf.org/html/rfc2104#section-2 */
                    $key = strlen($this->key) > $this->b ? call_user_func($this->hash, $this->key) : $this->key;

                    $key    = str_pad($key, $this->b, chr(0));      // step 1
                    $temp   = $this->ipad ^ $key;                   // step 2
                    $temp  .= $text;                                // step 3
                    $temp   = call_user_func($this->hash, $temp);   // step 4
                    $output = $this->opad ^ $key;                   // step 5
                    $output.= $temp;                                // step 6
                    $output = call_user_func($this->hash, $output); // step 7
            }
        } else {
            switch ($mode) {
                case self::MODE_MHASH:
                    $output = mhash($this->hash, $text);
                    break;
                case self::MODE_HASH:
                    $output = hash($this->hash, $text, true);
                    break;
                case self::MODE_INTERNAL:
                    $output = call_user_func($this->hash, $text);
            }
        }

        return substr($output, 0, $this->l);
    }
636772
public static function fromString($headerString)
    {
        $headerString = trim($headerString);
        list($name, $value) = explode(': ', trim($headerString), 2);
        return new self($name, $value);
    }
59272
public static function hashCode($string) {
		// Code from https://stackoverflow.com/a/40688976/3918483
		$hash = 0;
		if(!is_string($string)) {
			return $hash;
		}

		$len = mb_strlen($string, 'UTF-8');
		if($len === 0) {
			return $hash;
		}
		for($i = 0; $i < $len; $i++) {
			$c = mb_substr($string, $i, 1, 'UTF-8');
			$cc = unpack('V', iconv('UTF-8', 'UCS-4LE', $c))[1];
			$hash = (($hash << 5) - $hash) + $cc;
			$hash &= $hash; // 16bit > 32bit
		}
		return $hash;
	}
1285580
public static HashId createHashId(String string) throws IOException {
	try (ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(
		string.getBytes(Charset.defaultCharset()))) {
	    return createHashId(byteArrayInputStream);
	}
    }
450494
protected function useTokenCache($string, $currentStringLength)
    {
        $cacheKey = '';

        if ($currentStringLength >= $this->maxCacheKeySize) {
            $cacheKey = \substr($string, 0, $this->maxCacheKeySize);
        }

        return $cacheKey;
    }
316166
public function encryptWithUserSettings($string)
    {
        if (!$string) {
            return null;
        }

        // If the algorithm or salt is not available, it means we are operating
        // on legacy account with unhashed password. Do not hash the string.
        if (!$this->PasswordEncryption) {
            return $string;
        }

        // We assume we have PasswordEncryption and Salt available here.
        $e = PasswordEncryptor::create_for_algorithm($this->PasswordEncryption);

        return $e->encrypt($string, $this->Salt);
    }
916933
public function hash($algo = 'sha1')
    {
        $algos = new ArrayObject(hash_algos());
        if (!$algos->inArray($algo)) {
            throw new StringObjectException(StringObjectException::MSG_INVALID_HASH_ALGO, [$algo]);
        }

        $this->val(hash($algo, $this->val()));

        return $this;
    }
1352434
final protected function hhmac($string, $api_key_secret) {
    $key = base64_decode($api_key_secret);
    $hashed = hash_hmac('sha256', $string, $key, true);
    $encoded = base64_encode($hashed);
    $signature = rtrim($encoded, "\n");
    return strval($signature);
  }
178922
function (hashString) {
            var pairs = hashString, hashObject = {}, currentPair, currentPairString;
            pairs = (pairs) ? pairs.split(this._separatorRegExp) : [];
            for (var i = 0, size = pairs.length; size > i; i++) {
                currentPairString = pairs[i];
                currentPair = decodeURIComponent(currentPairString).split("=");
                if (currentPair.length == 2) {
                    hashObject[currentPair[0]] = currentPair[1];
                } else {
                    if (currentPairString.indexOf("=") == currentPairString.length) {
                        hashObject[currentPair[0]] = "";
                    } else {
                        hashObject["param" + i] = currentPair[0];
                    }
                }
            }
            return hashObject;
        }
125807
public static function hash($str, $algo = self::MD5_HASH, $hmacKey = '', $rawOuput = false, $salt = null, $passwordAlgo = PASSWORD_DEFAULT, $passwordOptions = [])
    {
        if ($hmacKey && in_array($algo, [self::MD5_HASH, self::SHA1_HASH])) {
            return hash_hmac($algo, $str, $hmacKey, $rawOuput);
        }

        switch ($algo) {
        case self::MD5_HASH:
            $hashCode = md5($str, $rawOuput);
            break;
        case self::SHA1_HASH:
            $hashCode = sha1($str, $rawOuput);
            break;
        case self::CRYPT_HASH:
            $hashCode = crypt($str, $salt);
            break;
        case self::PASSWORD_HASH:
            $hashCode = password_hash($str, $passwordAlgo, $passwordOptions);
            break;
        default:
            $hashCode = md5($str, $rawOuput);
        }

        return $hashCode;
    }
989560
protected static function hashEquals($knownString, $userString)
    {
        static $exists = null;
        if ($exists === null)  $exists = \function_exists('\\hash_equals');
        if ($exists)  return \hash_equals($knownString, $userString);
        $length = self::safeStrlen($knownString);
        if ($length !== self::safeStrlen($userString)) return false;
        $r = 0;
        for ($i = 0; $i < $length; ++$i) {
            $r |= \ord($userString[$i]) ^ \ord($knownString[$i]);
        }
        return $r === 0;
    }