Calculate the hash for the block header. Note that this has the bytes
        in the opposite order from how the header is usually displayed (so the
        long string of 00 bytes is at the end, not the beginning).
13012
def hash(self):
        """"""
        if not hasattr(self, "__hash"):
            self.__hash = self._calculate_hash()
        return self.__hash
1298133
def reverse_hash(hash, hex_format=True):
    
    if not hex_format:
        hash = hexlify(hash)
    return "".join(reversed([hash[i:i+2] for i in range(0, len(hash), 2)]))
748674
public function calculateHash()
    {
        $fullArray = $this->toArray();
        $configurationArray = [
            'view'     => $fullArray['view'],
            'settings' => $fullArray['settings']
        ];

        $this->hash = HashService::get()->getHash(serialize($configurationArray));
    }
338931
function(hash) {
				var l = buffer.length;
				
				while (l--) {
					if (buffer[l].hash == hash) {
						return l;
					}
				}
				return -1;
			}
755518
def hash(self):
        '''
        
        '''
        hashed = super(Pad, self).hash()
        return khash(hashed, self._pad_length, self._pad_data)
557444
def hash(self):
        
        hashvals = []
        if (self.md5 is not None):
            hashvals.append('md5:' + self.md5)
        if (self.sha1 is not None):
            hashvals.append('sha-1:' + self.sha1)
        if (self.sha256 is not None):
            hashvals.append('sha-256:' + self.sha256)
        if (len(hashvals) > 0):
            return(' '.join(hashvals))
        return(None)
126666
private byte[] calculateHash(String data) throws NoSuchAlgorithmException, UnsupportedEncodingException {
        MessageDigest md = MessageDigest.getInstance(HASH_ALGORITHM);
        md.update(data.getBytes(ENCODING));
        return md.digest();
    }
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);
    }
430166
def fast_hash(self):
        
        fast = sum(i.fast_hash() for i in self.data.values())
        return fast
250056
def block_header_to_hex( block_data, prev_hash ):
    
    header_info = {
       "version": block_data['version'],
       "prevhash": prev_hash,
       "merkle_root": block_data['merkleroot'],
       "timestamp": block_data['time'],
       "bits": int(block_data['bits'], 16),
       "nonce": block_data['nonce'],
       "hash": block_data['hash']
    }

    return block_header_serialize(header_info)
79567
def hash_file(file_path, block_size = 65536):
    
    sha = hashlib.sha256()
    with open(file_path, 'rb') as h_file:
        file_buffer = h_file.read(block_size)
        while len(file_buffer) > 0:
            sha.update(file_buffer)
            file_buffer = h_file.read(block_size)
    return sha.hexdigest()
425647
def hash(self):
        '''
        
        '''
        hashed = super(_LibraryBitField, self).hash()
        return khash(hashed, self._length, self._signed, self._min_value, self._max_value)
1152386
def calculate_payload_hash(payload, algorithm, content_type):
    """"""
    p_hash = hashlib.new(algorithm)

    parts = []
    parts.append('hawk.' + str(HAWK_VER) + '.payload\n')
    parts.append(parse_content_type(content_type) + '\n')
    parts.append(payload or '')
    parts.append('\n')

    for i, p in enumerate(parts):
        # Make sure we are about to hash binary strings.
        if not isinstance(p, six.binary_type):
            p = p.encode('utf8')
        p_hash.update(p)
        parts[i] = p

    log.debug('calculating payload hash from:\n{parts}'
              .format(parts=pprint.pformat(parts)))

    return b64encode(p_hash.digest())
1144749
def get_block_by_hash(self, block_hash: Hash32) -> BaseBlock:
        
        validate_word(block_hash, title="Block Hash")
        block_header = self.get_block_header_by_hash(block_hash)
        return self.get_block_by_header(block_header)
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()
64458
def hash_bytes( key, seed = 0x0, x64arch = True ):
    '''  '''

    hash_128 = hash128( key, seed, x64arch )

    bytestring = ''

    for i in xrange(0, 16, 1):
        lsbyte = hash_128 & 0xFF
        bytestring = bytestring + str( chr( lsbyte ) )
        hash_128 = hash_128 >> 8

    return bytestring
929525
public static int hashBytes(byte[] bytes, int offset, int length) {
    int hash = 1;
    for (int i = offset; i < offset + length; i++) {
      hash = (31 * hash) + bytes[i];
    }
    return hash;
  }