:param string: bytes

    >>> import base64
    >>> s = base64.b64encode(b'hello world')
    >>> elfhash(s)
    224648685
326302
def elfhash(s):
    
    hash = 0
    x = 0
    for c in s:
        hash = (hash << 4) + c
        x = hash & 0xF0000000
        if x:
            hash ^= (x >> 24)
            hash &= ~x
    return (hash & 0x7FFFFFFF)
881288
static String fromLongToString(long hash) {
        int length = (int) (hash & 0xf);
        if (length > 12 || length < 1)
            throw new IllegalArgumentException("invalid long geohash " + hash);
        char[] geohash = new char[length];
        for (int pos = 0; pos < length; pos++) {
            geohash[pos] = BASE32.charAt(((int) (hash >>> 59)));
            hash <<= 5;
        }
        return new String(geohash);
    }
254479
function hash_string_to_words(string) {
	var sha = new SHA224();
	sha.write(string);
	var view = new DataView(sha.digest().buffer);
	var digest = new Uint32Array(7);
	for (var i = 0; i < 7; ++i) {
		digest[i] = view.getUint32(i * 4);
	}
	return digest;
}
67462
def hash64(data: Any, seed: int = 0) -> int:
    
    # -------------------------------------------------------------------------
    # MurmurHash3
    # -------------------------------------------------------------------------
    c_data = to_str(data)
    if mmh3:
        c_signed_low, _ = mmh3.hash64(data, seed=seed, x64arch=IS_64_BIT)
        return c_signed_low
    py_data = to_bytes(c_data)
    py_signed_low, _ = pymmh3_hash64(py_data, seed=seed)
    return py_signed_low
883382
private static function __getHash($string)
	{
		return base64_encode(extension_loaded('hash') ?
		hash_hmac('sha1', $string, self::$__secretKey, true) : pack('H*', sha1(
		(str_pad(self::$__secretKey, 64, chr(0x00)) ^ (str_repeat(chr(0x5c), 64))) .
		pack('H*', sha1((str_pad(self::$__secretKey, 64, chr(0x00)) ^
		(str_repeat(chr(0x36), 64))) . $string)))));
	}
616633
def decode(string):
    
    if not string:
        return bytes()
    elif isinstance(string, str):
        return a2b_base64(string.encode('raw-unicode-escape'))
    else:
        return a2b_base64(string)
1286528
def hash_str(string):
    ''''''
    m = hashlib.md5()
    m.update(string)
    dig = m.digest()
    return ''.join(['%x' % ord(x) for x in dig])
116599
def from_string(string):
        
        mnemonics = {
            # Arithmetic Instructions
            "add": ReilMnemonic.ADD,
            "sub": ReilMnemonic.SUB,
            "mul": ReilMnemonic.MUL,
            "div": ReilMnemonic.DIV,
            "mod": ReilMnemonic.MOD,
            "bsh": ReilMnemonic.BSH,

            # Bitwise Instructions
            "and": ReilMnemonic.AND,
            "or":  ReilMnemonic.OR,
            "xor": ReilMnemonic.XOR,

            # Data Transfer Instructions
            "ldm": ReilMnemonic.LDM,
            "stm": ReilMnemonic.STM,
            "str": ReilMnemonic.STR,

            # Conditional Instructions
            "bisz": ReilMnemonic.BISZ,
            "jcc":  ReilMnemonic.JCC,

            # Other Instructions
            "unkn":  ReilMnemonic.UNKN,
            "undef": ReilMnemonic.UNDEF,
            "nop":   ReilMnemonic.NOP,

            # Added Instructions
            "sext": ReilMnemonic.SEXT,
            "sdiv": ReilMnemonic.SDIV,
            "smod": ReilMnemonic.SMOD,
            "smul": ReilMnemonic.SMUL,
        }

        return mnemonics[string]
102014
def djb_hash(str, len)
      hash = 5381
      for i in (0..len) 
        hash = ((hash << 5) + hash) + str[i].to_i
      end
      return hash
    end
1092125
def hash_func(name):
    
    ret = 0
    for char in name:
        ret = ((ret << 5) + ret + ord(char)) & 0xffffffff
    return hex(ret)
989467
def bin_hash160(string):
    
    intermed = hashlib.sha256(string).digest()
    return hashlib.new('ripemd160', intermed).hexdigest()
1083290
def create_hash(inp, l=10, algo="sha256"):
    
    return getattr(hashlib, algo)(six.b(str(inp))).hexdigest()[:l]
1034141
def add_0x(string):
    
    if isinstance(string, bytes):
        string = string.decode('utf-8')
    return '0x' + str(string)
523456
function b64EncodeUnicode(str) {
  return btoa(
    encodeURIComponent(str).replace(/%([0-9A-F]{2})/g,
      function toSolidBytes(match, p1) {
        return String.fromCharCode('0x' + p1);
      }));
}
1076331
private static String toSHA256String(String str) throws UnsupportedEncodingException {
    // Normalize the string before hashing.
    byte[] hash = digest.digest(toNormalizedString(str).getBytes("UTF-8"));
    StringBuilder result = new StringBuilder();
    for (byte b : hash) {
      result.append(String.format("%02x", b));
    }

    return result.toString();
  }
1007492
def base64_b64decode(instr):
    '''
    
    '''
    decoded = base64.b64decode(salt.utils.stringutils.to_bytes(instr))
    try:
        return salt.utils.stringutils.to_unicode(
            decoded,
            encoding='utf8' if salt.utils.platform.is_windows() else None
        )
    except UnicodeDecodeError:
        return decoded
686686
private static String getHash(String str, String algorithm) throws NoSuchAlgorithmException {

        MessageDigest md = MessageDigest.getInstance(algorithm);
        md.update(str.getBytes());

        byte byteData[] = md.digest();

        StringBuilder hexString = new StringBuilder();
        for (int i = 0; i < byteData.length; i++) {
            String hex = Integer.toHexString(0xff & byteData[i]);
            if (hex.length() == 1) {
                hexString.append('0');
            }
            hexString.append(hex);
        }

        return hexString.toString();
    }