Skip to main content

Tree Hash Calculator

Calculates a SHA256 (or, potentially, any other hashlib supported function) “tree” hash, as used by e.g. Amazon Glacier.

Command line usage:

$ treehash <filename> ...

As a library, we follow the hashlib conventions. That is:

>>> from treehash import TreeHash
>>> treehash = TreeHash()
>>> treehash.update(b"Nobody inspects")
>>> treehash.update(b" the spammish repetition")
>>> treehash.digest()
'\x03\x1e\xdd}Ae\x15\x93\xc5\xfe\\\x00o\xa5u+7\xfd\xdf\xf7\xbcN\x84:\xa6\xaf\x0c\x95\x0fK\x94\x06'
>>> treehash.hexdigest()
'031edd7d41651593c5fe5c006fa5752b37fddff7bc4e843aa6af0c950f4b9406'

Note that it is possible to specify the block size (Glacier uses 1 MB) and hash algorithm used:

>>> treehash = TreeHash(algo=hashlib.md5, block_size=2048*2048)

Metadata

Release files for TreeHash 1.0.2

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

Source distribution (sdist)

Source distribution for TreeHash 1.0.2
File Size Uploaded Provenance
TreeHash-1.0.2.tar.gz 1.9 kB Without provenance Details

Release files / TreeHash-1.0.2.tar.gz

Download URL TreeHash-1.0.2.tar.gz
Size 1.9 kB
Tags Source
SHA-256 checksum
How to use checksums
fefcadd6a1e8ba2808897d776d5ae8bdae56ec3fe90ed385c1322357269f27a4
BLAKE2b-256 checksum
How to use checksums
6230be0aafe80d0935901bf13af6b5c7ac776fd9391a6e70ba303965ad341c85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for TreeHash 1.0.2

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