B Bd\R@sddlmZGdddZdS))hexlifyc@sLeZdZdZdZdZdddZddZddZd d Z d d Z dd dZ dS)HashAlgozeA generic class for an abstract cryptographic hash algorithm. :undocumented: block_size NcCs0t|dr||_n||_|r,||dS)aInitialize the hash object. :Parameters: hashFactory : callable An object that will generate the actual hash implementation. *hashFactory* must have a *new()* method, or must be directly callable. data : byte string The very first chunk of the message to hash. It is equivalent to an early call to `update()`. newN)hasattrr_hashupdate)selfZ hashFactorydatar G/opt/alt/python37/lib64/python3.7/site-packages/Crypto/Hash/hashalgo.py__init__"s  zHashAlgo.__init__cCs |j|S)aContinue hashing of a message by consuming the next chunk of data. Repeated calls are equivalent to a single call with the concatenation of all the arguments. In other words: >>> m.update(a); m.update(b) is equivalent to: >>> m.update(a+b) :Parameters: data : byte string The next chunk of the message being hashed. )rr)rr r r r r5szHashAlgo.updatecCs |jS)arReturn the **binary** (non-printable) digest of the message that has been hashed so far. This method does not change the state of the hash object. You can continue updating the object after calling this function. :Return: A byte string of `digest_size` bytes. It may contain non-ASCII characters, including null bytes. )rdigest)rr r r r Gs zHashAlgo.digestcCs |jS)aReturn the **printable** digest of the message that has been hashed so far. This method does not change the state of the hash object. :Return: A string of 2* `digest_size` characters. It contains only hexadecimal ASCII digits. )r hexdigest)rr r r rRszHashAlgo.hexdigestcCs |jS)a4Return a copy ("clone") of the hash object. The copy will have the same internal state as the original hash object. This can be used to efficiently compute the digests of strings that share a common initial substring. :Return: A hash object of the same type )rcopy)rr r r r\s z HashAlgo.copycCsdS)aReturn a fresh instance of the hash object. Unlike the `copy` method, the internal state of the object is empty. :Parameters: data : byte string The next chunk of the message being hashed. :Return: A hash object of the same type Nr )rr r r r rhs z HashAlgo.new)N)N) __name__ __module__ __qualname____doc__Z digest_sizeZ block_sizer rr rrrr r r r rs    rN)Zbinasciirrr r r r s