Package Crypto :: Package Hash :: Module RIPEMD :: Class RIPEMD160Hash
[frames] | no frames]

Class RIPEMD160Hash

hashalgo.HashAlgo --+
                    |
                   RIPEMD160Hash

Class that implements a RIPMD-160 hash
Instance Methods
 
__init__(self, data=None)
Initialize the hash object.
 
new(self, data=None)
Return a fresh instance of the hash object.
    Inherited from hashalgo.HashAlgo
 
copy(self)
Return a copy ("clone") of the hash object.
 
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.
 
update(self, data)
Continue hashing of a message by consuming the next chunk of data.
Class Variables
  oid = '\x06\x05+$\x03\x02\x01'
ASN.1 Object identifier (OID):
  digest_size = 20
The size of the resulting hash in bytes.
Method Details

__init__(self, data=None)
(Constructor)

 
Initialize the hash object.
Parameters:
  • hashFactory - An object that will generate the actual hash implementation. hashFactory must have a new() method, or must be directly callable.
  • data - The very first chunk of the message to hash. It is equivalent to an early call to update().
Overrides: hashalgo.HashAlgo.__init__
(inherited documentation)

new(self, data=None)

 

Return a fresh instance of the hash object.

Unlike the copy method, the internal state of the object is empty.

Parameters:
  • data - The next chunk of the message being hashed.
Returns:
A hash object of the same type
Overrides: hashalgo.HashAlgo.new
(inherited documentation)

Class Variable Details

oid

ASN.1 Object identifier (OID):

id-ripemd160 OBJECT IDENTIFIER ::= {
    iso(1) identified-organization(3) teletrust(36)
     algorithm(3) hashAlgorithm(2) ripemd160(1)
}

This value uniquely identifies the RIPMD-160 algorithm.

Value:
'\x06\x05+$\x03\x02\x01'