Module SHA
SHA-1 cryptographic hash algorithm.
SHA-1 produces the 160 bit digest of a message.
>>> from Crypto.Hash import SHA
>>>
>>> h = SHA.new()
>>> h.update(b'Hello')
>>> print h.hexdigest()
SHA stands for Secure Hash Algorithm.
This algorithm is not considered secure. Do not use it for new designs.
|
SHA1Hash
Class that implements a SHA-1 hash
|
|
new(data=None)
Return a fresh instance of the hash object. |
|
|
|
digest_size = 20
The size of the resulting hash in bytes.
|
Return a fresh instance of the hash object.
- Parameters:
data (byte string) - The very first chunk of the message to hash.
It is equivalent to an early call to SHA1Hash.update().
Optional.
- Returns:
- A SHA1Hash object
|