Ejemplo n.º 1
0
 def _hash_from_file(self, fp, start, size, blockhash):
     fp.seek(start)
     block = readall(fp, size)
     h = newhashlib(blockhash)
     h.update(block.strip('\x00'))
     return hexlify(h.digest())
Ejemplo n.º 2
0
def _pithos_hash(block, blockhash):
    h = newhashlib(blockhash)
    h.update(block.rstrip('\x00'))
    return h.hexdigest()