Convenience for calculating the pod hash for a string.
549605
public static int getPodHash(String key)
  {
    byte []buffer = new byte[16];
    
    int sublen = Math.min(key.length(), 8);
    
    for (int i = 0; i < sublen; i++) {
      buffer[i] = (byte) key.charAt(i);
    }
    
    long hash = Murmur64.generate(Murmur64.SEED, key);
    
    BitsUtil.writeLong(buffer, 8, hash);
    
    return calculatePodHash(buffer, 0, 16);
  }
126666
private byte[] calculateHash(String data) throws NoSuchAlgorithmException, UnsupportedEncodingException {
        MessageDigest md = MessageDigest.getInstance(HASH_ALGORITHM);
        md.update(data.getBytes(ENCODING));
        return md.digest();
    }
186012
private static String computeKeyHash(String memcachedPrefix, NamedKey key)
  {
    // hash keys to keep things under 250 characters for memcached
    return memcachedPrefix + ":" + DigestUtils.sha1Hex(key.namespace) + ":" + DigestUtils.sha1Hex(key.key);
  }
1139875
def calculate_hash(obj):
    

    hashable_fields = {
        'Chamber': ['name', 'country', 'abbreviation'],
        'Constituency': ['name'],
        'Group': ['name', 'abbreviation', 'kind', 'chamber'],
        'Mandate': ['group', 'constituency', 'role', 'begin_date', 'end_date',
            'representative']
    }

    fingerprint = hashlib.sha1()
    for field_name in hashable_fields[obj.__class__.__name__]:
        field = obj._meta.get_field(field_name)
        if field.is_relation:
            related = getattr(obj, field_name)
            if related is None:
                fingerprint.update(smart_str(related))
            else:
                fingerprint.update(related.fingerprint)
        else:
            fingerprint.update(smart_str(getattr(obj, field_name)))
    obj.fingerprint = fingerprint.hexdigest()
    return obj.fingerprint
819927
def hashZ(*args):
    
    TAG = "TAG_RELIC_HASH_Z"
    MESSAGE = "MESSAGE_HASH_Z"

    # Combine the arguments into a canonical string representation.
    text = TAG.join([str(val) for val in args ] )

    # Hash the string using HMAC
    # b: byte string 
    b = hmac(text, MESSAGE)
    return BigInt(longFromString(b))
825503
function getHash(str, algorithm) {
  algorithm = algorithm || 'md5';
  var hash = crypto.createHash(algorithm);
  hash.end(str);
  return hash.read();
}
781395
function hashThisString(string) {
    var hash = 0;
    if (string.length === 0) { return hash; }
    for (var i = 0; i < string.length; i++) {
      var char = string.charCodeAt(i);
      hash = ((hash << 5) - hash) + char;
      hash = hash & hash; // Convert to 32bit integer
    }
    return hash;
  }
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
425318
def compiled_hash_func(self):
        """"""

        def get_primary_key_str(pkey_name):
            return "str(self.{})".format(pkey_name)

        hash_str = "+ ".join([get_primary_key_str(n) for n in self.primary_keys])
        return ALCHEMY_TEMPLATES.hash_function.safe_substitute(concated_primary_key_strs=hash_str)
908266
def typed_hash_key(*args, **kwargs):
    """"""

    key = hash_key(*args, **kwargs)
    key += tuple(type(v) for v in args)
    key += tuple(type(v) for _, v in sorted(kwargs.items()))
    return key
1092125
def hash_func(name):
    
    ret = 0
    for char in name:
        ret = ((ret << 5) + ret + ord(char)) & 0xffffffff
    return hex(ret)
706522
function(_key,_data){
        var _bkey = __str2bin(_key,!0);
        if (_bkey.length>16)
            _bkey = __data2md5(_bkey,_key.length*__chrsz);

        var _ipad = Array(16),
            _opad = Array(16);
        for(var i=0;i<16;i++){
            _ipad[i] = _bkey[i]^0x36363636;
            _opad[i] = _bkey[i]^0x5C5C5C5C;
        }

        var _hash = __data2md5(_ipad.concat(
                               __str2bin(_data,!0)),
                               512+_data.length*__chrsz);
        return __data2md5(_opad.concat(_hash),512+128);
    }
339159
function hash(s) {
    var h = hash.BASE

    for (var i = 0, l = s.length; i < l; i++) {
        h ^= s.charCodeAt(i)
        h += (h << 1) + (h << 4) + (h << 7) + (h << 8) + (h << 24)
    }

    return h >>> 0
}
850349
public static int sdbmHash(String str) {
		int hash = 0;

		for (int i = 0; i < str.length(); i++) {
			hash = str.charAt(i) + (hash << 6) + (hash << 16) - hash;
		}

		return hash & 0x7FFFFFFF;
	}
322139
def options_hash_to_string(options)
      result = ''
      options.sort_by { |key, _| OPTION_ORDER.find_index(key) || -1 }.each do |key, value|
        if value
          result += "set #{OptionHandling.option_to_string(key, value)}\n"
        else
          result += "unset #{key}\n"
        end
      end
      result
    end
366495
def hashkey(*args, **kwargs):
    """"""

    if kwargs:
        return _HashedTuple(args + sum(sorted(kwargs.items()), _kwmark))
    else:
        return _HashedTuple(args)
268972
function hash() {
  var h = 0;
  for (var i = 0; i < arguments.length; i++) {
    var k = arguments[i];
    h += k;
    h += k << 10;
    h ^= k >> 6;
  }
  h += h << 3;
  h ^= h >> 11;
  h += h << 15;
  return h >= 0 ? h : -h;
}