Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Tree Hash Calculator

Project description

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()
>>> treehash.hexdigest()

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)

Project details

Download files

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

Files for TreeHash, version 1.0.2
Filename, size File type Python version Upload date Hashes
Filename, size TreeHash-1.0.2.tar.gz (1.9 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page