!!! abstract "简介"
`uhashlib` 模块实现了二进制数据哈希算法。
The current generation, modern hashing algorithm (of SHA2 series). It is suitable for cryptographically-secure purposes. Included in the MicroPython core and any board is recommended to provide this, unless it has particular code size constraints.
A previous generation algorithm. Not recommended for new usages, but SHA1 is a part of number of Internet standards and existing applications, so boards targetting network connectivity and interoperatiability will try to provide this.
A legacy algorithm, not considered cryptographically secure. Only selected boards, targetting interoperatibility with legacy applications, will offer this.
创建一个SHA256哈希对象并提供 data 赋值。
创建一个SHA1哈希对象并提供 data 赋值。
创建一个MD5哈希对象并提供 data 赋值。
将更多二进制数据放入哈希表中。
返回字节对象哈希的所有数据。调用此方法后,将无法将更多数据送入哈希。
此方法没有实现, 使用 ubinascii.hexlify(hash.digest()) 达到类似效果。
更多内容可参考 uhashlib 。