资 源 简 介
Slow SHA
Also on github: https://github.com/sfstpala/SlowSHA
This single-file module implements the hashing algorithms sha1, sha224, sha256, sha384, and sha512 in pure Python. The code doesn"t contain too many optimisations, which makes it fairly easy to read.
Note that this code is for educational purposes. Python"s native C implementation of SHA1/SHA2 is much faster and better tested.
Usage:
>>> import slowsha>>> slowsha.sha224(b"Python 3000").hexdigest()"ca10838d71bcd91cfc3e474867a5ed2f13feb14ee91a6dab2526a96b">>> slowsha.sha1(b"hello").digest()b"xaaxf4xc6x1dxdcxc5xe8xa2xdaxbexdex0f;H,xd9xaexa9CM">>> slowsha.sha224(b"Hello World")
Download (0.1)
请点击左侧文件开始预览 !预览只提供20%的代码片段,完整代码需下载后查看 加载中 侵权举报