Skip to main content

Serializable hash objects

Project description

Hashstate

This is a Python C extension module that forks the hashlib implementation from CPython itself to add support for a single feature: the ability to serialize and deserialize hash objects so that the hash objects do not have to persist in memory for the whole duration of the hash computation.

Usage

pip install hashstate
import hashstate

# Contains all the same constructors as hashlib
hash1 = hashstate.sha512()
hash1.update('...')
s = hash1.serialize()  # gives back bytes object

hash2 = hashstate.sha512()
hash2.deserialize(s)
assert hash1.digest() == hash2.digest()

Developers

Build the package (requires openssl on your build paths):

python setup.py sdist bdist_wheel

If building a MacOS wheel, also run:

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

Build the linux bdist_wheels (64-bit only at the moment):

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

Upload to pypi

twine upload dist/*

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hashstate-0.2.1.tar.gz (7.4 kB view hashes)

Uploaded Source

Built Distributions

hashstate-0.2.1-cp36-cp36m-manylinux1_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.6m

hashstate-0.2.1-cp36-cp36m-macosx_10_13_x86_64.whl (1.1 MB view hashes)

Uploaded CPython 3.6m macOS 10.13+ x86-64

hashstate-0.2.1-cp35-cp35m-manylinux1_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.5m

hashstate-0.2.1-cp34-cp34m-manylinux1_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.4m

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page