Package Cryptodome :: Package Hash :: Module SHA3_256 :: Class SHA3_256_Hash

Class SHA3_256_Hash

object --+
         |
        SHA3_256_Hash

Class that implements a SHA-3/256 hash
Instance Methods
 
__init__(self, data, update_after_digest)
x.__init__(...) initializes x; see help(type(x)) for signature
 
update(self, data)
Continue hashing of a message by consuming the next chunk of data.
 
digest(self)
Return the binary (non-printable) digest of the message that has been hashed so far.
 
hexdigest(self)
Return the printable digest of the message that has been hashed so far.
 
new(self)

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables
  digest_size = 32
The size of the resulting hash in bytes.
  oid = '2.16.840.1.101.3.4.2.8'
ASN.1 Object ID
Properties

Inherited from object: __class__

Method Details

__init__(self, data, update_after_digest)
(Constructor)

 
x.__init__(...) initializes x; see help(type(x)) for signature
Overrides: object.__init__
(inherited documentation)

update(self, data)

 

Continue 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.

digest(self)

 

Return the binary (non-printable) digest of the message that has been hashed so far.

You cannot update the hash anymore after the first call to digest (or hexdigest).

Returns:
A byte string of digest_size bytes. It may contain non-ASCII characters, including null bytes.

hexdigest(self)

 

Return the printable digest of the message that has been hashed so far.

This method does not change the state of the hash object.

Returns:
A string of 2* digest_size characters. It contains only hexadecimal ASCII digits.