Calculates hash from a buffer
965242
public static long generate(long hash, 
                              long value)
  {
    final long m = 0xc6a4a7935bd1e995L;
    final int r = 47;
    
    int length = 8;
    
    hash ^= length * m;

    long k = Long.reverseBytes(value);
      
    k *= m;
    k ^= k >>> r;
    k *= m;
    hash ^= k;
    hash *= m;
    
    hash ^= hash >>> r;
    hash *= m;
    hash ^= hash >>> r;
    
    return hash;
  }
23767
def _string_hash(s):
    """"""
    h = 5381
    for c in s:
        h = h * 33 + ord(c)
    return h
230693
def khash(*args):
    '''
    
    '''
    ksum = sum([hash(arg if arg is not None else -13371337) for arg in args])
    return hash(str(ksum))
155934
def np_hash(a):
    """"""
    if a is None:
        return hash(None)
    # Ensure that hashes are equal whatever the ordering in memory (C or
    # Fortran)
    a = np.ascontiguousarray(a)
    # Compute the digest and return a decimal int
    return int(hashlib.sha1(a.view(a.dtype)).hexdigest(), 16)
358788
private static int hash(Object x, int length) {
        int h = System.identityHashCode(x);
        // Multiply by -127, and left-shift to use least bit as part of hash
        return ((h << 1) - (h << 8)) & (length - 1);
    }
744847
def calc_hash(self, hashalg=None):
        
        fd = open(self.filename, "rb")
        buf = fd.read()
        fd.close()
        if hashalg:
            self.hashalg = hashalg.upper()
        self.hash = getattr(hashlib, self.hashalg.lower())(buf).hexdigest()
913880
def num_leading_hashes(s)
		i=0;
		while i<(s.size-1) && (s[i,1]=='#'); i+=1 end
		i	
	end
430528
def calculate_hash(options):
        """"""
        options = sorted(list(options))
        sha_hash = sha1()
        # equivalent to loop over the options and call sha_hash.update()
        sha_hash.update(''.join(options).encode('utf-8'))
        return sha_hash.hexdigest()
861949
private int hashinateBytes(Object obj) {
        byte[] bytes = VoltType.valueToBytes(obj);
        if (bytes == null) {
            return 0;
        }

        ByteBuffer buf = ByteBuffer.wrap(bytes);
        final int hash = MurmurHash3.hash3_x64_128(buf, 0, bytes.length, 0);
        long token = getTokenPtr(hash);
        return Bits.unsafe.getInt(token + 4);
    }
503514
private int hash(int start, int byteCount) {
    assert byteCount % ARC_SIZE == 0 : "Not an arc multiply?";

    int h = 0;
    for (int arcs = byteCount / ARC_SIZE; --arcs >= 0; start += ARC_SIZE) {
      h = 17 * h + getArcLabel(start);
      h = 17 * h + getArcTarget(start);
      if (isArcFinal(start))
        h += 17;
    }

    return h;
  }
886814
def gethash(compiled):
    """"""
    lines = compiled.splitlines()
    if len(lines) < 3 or not lines[2].startswith(hash_prefix):
        return None
    else:
        return lines[2][len(hash_prefix):]
191213
def hash_bytes(buf):
    
    sha256 = hashlib.sha256()
    sha256.update(buf)
    return 'sha256:' + sha256.hexdigest()
599114
public static int hash(ByteBuffer buf, int seed) {
		  
	    // save byte order for later restoration
	    ByteOrder byteOrder = buf.order();
	    buf.order(ByteOrder.LITTLE_ENDIAN);

		  int m = 0x5bd1e995;
		  int r = 24;

	    int h = seed ^ buf.remaining();
	    
	    while (buf.remaining() >= 4) {
	    	
	    	int k = buf.getInt();
	    	
	    	k *= m;
	    	k ^= k >>> r;
	    	k *= m;
	    	h *= m;
	    	h ^= k;
	    }

	    if (buf.remaining() > 0) {
	      ByteBuffer finish = ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN);
	      // for big-endian version, use this first:
	      // finish.position(4-buf.remaining());
	      finish.put(buf).rewind();
	      h ^= finish.getInt();
	      h *= m;
	    }

	    h ^= h >>> 13;
	    h *= m;
	    h ^= h >>> 15;

	    buf.order(byteOrder);
	    return h;
	  }
831714
private static int hash(char []key, int length)
  {
    int hash = 17;

    for (int i = length - 1; i >= 0; i--) {
      char a = key[i];

      if ('A' <= a && a <= 'Z')
        a += 'a' - 'A';
      
      hash = 65537 * hash + a;
    }

    return hash;
  }
1044772
@Override
    public final long hash(byte[] buffer) {
        long hash = hash(buffer, 1);
        return (hash == HashFunction.NON_HASH_CODE) ? HashFunction.MAX_HASH_CODE : hash;
    }
1042518
public static String calculateSHAHash(String s) throws
    NoSuchAlgorithmException, UnsupportedEncodingException
  {
    MessageDigest md = MessageDigest.getInstance("SHA-256");
    md.update(s.getBytes("UTF-8"));
    byte[] digest = md.digest();

    StringBuilder hashVal = new StringBuilder();
    for (byte b : digest)
    {
      hashVal.append(String.format("%02x", b));
    }

    return hashVal.toString();
  }
629460
function hashToInts(hash) {
  var arr = []
  var num = 4

  for (var i = 0; i < 4; i++) {
    var part = hash.substr(i*8,8)
    var n = parseInt(part, 16) & 0x7fffffff
    arr.push(n)
  }

  return arr

}