Get a CRC32 or xxhash.xxh64 reflecting the DataStore.

        Returns
        ------------
        hashed: int, checksum of data
430166
def fast_hash(self):
        
        fast = sum(i.fast_hash() for i in self.data.values())
        return fast
1181405
def verify(self):
        

        # remember file pointer
        pos = self.tell()
        self.seek(0)

        checksum = 0
        for chunk in iter(lambda: self.read(1024), b''):
            checksum = crc32(chunk, checksum)

        # restore file pointer
        self.seek(pos)

        return self.crc32 == checksum & 0xffffffff
206753
def get_hash(fName, readSize, dire=pDir()):
    
    if not fileExists(fName, dire):
        return -1
    readSize = readSize * 1024 # bytes to be read
    fName = os.path.join(dire, fName) # name coupled with path
    with open(fName, 'rb') as f:
        size = os.path.getsize(fName)
        if size < readSize * 2:
            return -1
        data = f.read(readSize)
        f.seek(-readSize, os.SEEK_END)
        data += f.read(readSize)
    return md5(data).hexdigest()
943306
def get_hash(self, length=HASH_LENGTH):
        

        data_hash = ""
        if not self.data_str:
            return data_hash

        encoded_data_str = self.data_str
        if sys.version_info.major == 2:
            # In Py2, only unicode needs to be encoded.
            if isinstance(self.data_str, unicode):
                encoded_data_str = self.data_str.encode('utf-8')
        else:
            # data_str should always be unicode on python 3
            encoded_data_str = self.data_str.encode('utf-8')

        data_hash = hashlib.sha1(encoded_data_str).hexdigest()

        return data_hash[:length]
651805
def get_body_hash(params):
    
    norm_params = get_normalized_params(params)

    return binascii.b2a_base64(hashlib.sha1(norm_params).digest())[:-1]
765539
MD5MD5CRC32FileChecksum getFileChecksum(String src) throws IOException {
    checkOpen();
    return getFileChecksum(dataTransferVersion,
        src, namenode, namenodeProtocolProxy, socketFactory, socketTimeout);
  }
755518
def hash(self):
        '''
        
        '''
        hashed = super(Pad, self).hash()
        return khash(hashed, self._pad_length, self._pad_data)
445861
def get_canonical_block_hash(self, block_number: BlockNumber) -> Hash32:
        
        return self._get_canonical_block_hash(self.db, block_number)
837776
public static String computeHash(final InternalResource resource) {
		final int bufferSize = 1024;
		try (InputStream stream = resource.getStream()) {

			if (stream == null) {
				return null;
			}

			// Compute CRC-32 checksum
			// TODO: Is a 1 in 2^32 chance of a cache bust fail good enough?
			// Checksum checksumEngine = new Adler32();
			Checksum checksumEngine = new CRC32();
			byte[] buf = new byte[bufferSize];

			for (int read = stream.read(buf); read != -1; read = stream.read(buf)) {
				checksumEngine.update(buf, 0, read);
			}

			return Long.toHexString(checksumEngine.getValue());
		} catch (Exception e) {
			throw new SystemException("Error calculating resource hash", e);
		}
	}
1244275
def _calc_checksum(self, secret):
        
        return str_to_uascii(
            hashlib.sha256(mysql_aes_encrypt(self.salt, secret)).hexdigest()
        )
247974
def data_for_base58check_encoding
      data = BTC::Data.data_from_bytes([self.version]) + @data
      if @public_key_compressed
        data += BTC::Data.data_from_bytes([0x01])
      end
      return data
    end
501946
def _get_checksum(path):
    

    # md5 uses a 512-bit digest blocks, let's scale by defined block_size
    _md5 = hashlib.md5()
    chunk_size = 128 * _md5.block_size

    try:
        with open(path, 'rb') as _file:
            for chunk in iter(lambda: _file.read(chunk_size), ''):
                _md5.update(chunk)
        return _md5.hexdigest()

    except IOError:
        return None
751261
def get_content_hash(self):
        
        if not self.rexists():
            return SCons.Util.MD5signature('')
        fname = self.rfile().get_abspath()
        try:
            cs = SCons.Util.MD5filesignature(fname,
                chunksize=SCons.Node.FS.File.md5_chunksize*1024)
        except EnvironmentError as e:
            if not e.filename:
                e.filename = fname
            raise
        return cs
304196
def from_pubkey(cls: Type[CRCPubkeyType], pubkey: str) -> CRCPubkeyType:
        
        hash_root = hashlib.sha256()
        hash_root.update(base58.b58decode(pubkey))
        hash_squared = hashlib.sha256()
        hash_squared.update(hash_root.digest())
        b58_checksum = ensure_str(base58.b58encode(hash_squared.digest()))

        crc = b58_checksum[:3]
        return cls(pubkey, crc)
1219174
def hash32(data: Any, seed=0) -> int:
    
    with MultiTimerContext(timer, TIMING_HASH):
        c_data = to_str(data)
        if mmh3:
            return mmh3.hash(c_data, seed=seed)
        py_data = to_bytes(c_data)
        py_unsigned = murmur3_x86_32(py_data, seed=seed)
        return twos_comp_to_signed(py_unsigned, n_bits=32)
416861
def get_data_hash(data_txt):
    
    h = hashlib.sha256()
    h.update(data_txt)
    return h.hexdigest()
244382
def get_checksum(file):
    
    with open(file, 'rb') as FH:
        contents = FH.read()
    return hashlib.sha256(contents).hexdigest()