可序列化哈希对象

hashstate的Python项目详细描述


哈希状态

这是一个python c扩展模块,它派生hashlib实现 从cpython本身添加对单个特性的支持:能够 序列化和反序列化哈希对象,以便哈希对象不具有 在哈希计算的整个过程中保持在内存中。

用法

pip install hashstate
importhashstate# Contains all the same constructors as hashlibhash1=hashstate.sha512()hash1.update('...')s=hash1.serialize()# gives back bytes objecthash2=hashstate.sha512()hash2.deserialize(s)asserthash1.digest()==hash2.digest()

开发人员

生成包(在生成路径上需要openssl):

python setup.py sdist bdist_wheel

如果要构建MacOS控制盘,请运行:

delocate-wheel -v ./dist/*-macosx_*.whl

构建Linux bdist_控制盘(目前仅64位):

docker build -t manylinux-hashstate .
docker run --rm -v $(pwd)/dist:/dist manylinux-hashstate

上载到PYPI

twine upload dist/*

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java编辑并重新运行spring引导单元测试,无需重新加载上下文即可加快测试速度   为什么我不能做演员?   java为什么是线程。join通常用于停止安卓中的线程   java从weblogic服务器调用JSON POST REST服务时收到400:错误请求   java在DeviceAdmin模式禁用时设置身份验证?   java SortedMap的keySet()能否始终安全地强制转换到SortedSet?   安卓 java。lang.NoSuchMethodException可包裹类   java JOGL库安装   javatomcat内存管理   java使用getString()中的变量   java将最小星号设置为评级栏   Java中字符串相等的println()方法。。。它到底是如何工作的?   java如何从文本中输出的数组中放入随机图像