Skip to main content

Rehash: Resumable Hashlib

Rehash is a resumable interface to the OpenSSL-based hashers (message digest objects) in the CPython hashlib standard library. Rehash provides hashers that can be pickled, persisted and reconstituted from their repr(), and otherwise serialized. The rest of the Rehash API is identical to hashlib.

Rehash hashers can be used to checkpoint and restore progress when hashing large byte streams:

import pickle, rehash
hasher = rehash.sha256(b"foo")
state = pickle.dumps(hasher)

hasher2 = pickle.loads(state)
hasher2.update(b"bar")

assert hasher2.hexdigest() == rehash.sha256(b"foobar").hexdigest()

Installation

pip install rehash

Applications

Rehash is useful in any situation when your VM is short-lived or preemptible, and the object you’re hashing is huge. For example, Rehash can be used to hand off the hashing state of large objects between AWS Lambda functions or Google Cloud Functions, which have runtime limits of 15 and 9 minutes, respectively.

License

Licensed under the terms of the Apache License, Version 2.0.

https://github.com/kislyuk/rehash/workflows/Python%20package/badge.svg https://codecov.io/github/kislyuk/rehash/coverage.svg?branch=master https://img.shields.io/pypi/v/rehash.svg https://img.shields.io/pypi/l/rehash.svg https://readthedocs.org/projects/rehash/badge/?version=latest

Metadata

Release files for rehash 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rehash 1.0.1
File Size Uploaded Provenance Actions
rehash-1.0.1.tar.gz 9.3 kB Without provenance Details for rehash-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rehash 1.0.1
File Interpreter ABI Platform Actions
rehash-1.0.1-py2.py3-none-any.whl Python 3, Python 2 none any Details for rehash-1.0.1-py2.py3-none-any.whl

Total release size: 18.3 kB

Release files / rehash-1.0.1.tar.gz

Download URL rehash-1.0.1.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
17abf2400fe1361c036fea2f7963c852ec5b6d52d4718ff345e0fa9914e861e2
BLAKE2b-256 checksum
How to use checksums
d315786002df819c59f1c1e68725db2ca9d2820d5bdb0f616ae03e6f0fe0a483
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.13

Release files / rehash-1.0.1-py2.py3-none-any.whl

Download URL rehash-1.0.1-py2.py3-none-any.whl
Size 9.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
bbce1e17887dad67317d3e59cb091be8e130f1a9e35e3f0129d5df1b5896a869
BLAKE2b-256 checksum
How to use checksums
639851a7b433437794184fb7846960c1af275a1efa01baa481f49ed58bc2f20a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.13

Security for rehash 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page