Class: sha256 | src/sha256.py | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
256 bit Secure Hash Algorithm (SHA-256)The sha256 python class builds on NIST's SHA 256 implementation written in ANSI C by Aaron D. Gifford. The interface is very much like the standard python sha, the primary difference being the length of the digest. This class extends sha from 160 to 256 bits. Usage Example: >>> from sha256.sha256 import sha256 >>> hasher = sha256() >>> hasher.update('1234567890') >>> hasher.digest() 'w߉q1?-Mp@ س' >>> hasher.update('1234567890') >>> hasher.digest() 'P~x32cj +&πAk:/q' The digest returned will invariably be 32 bytes (256 bits).
|