Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

merkle-tree-stream

Build Status

A stream that generates a merkle tree based on the incoming data

A hash tree or merkle tree is a tree in which every leaf node is labelled with the hash of a data block and every non-leaf node is labelled with the cryptographic hash of the labels of its child nodes. Merkle trees in Dat are specialized flat trees that contain the content of the archives.

Install

$ pip install merkle-tree-stream

Example

import hashlib

def _leaf(node, roots=None):
    return hashlib.sha256(node.data).digest()

def _parent(first, second):
    sha256 = hashlib.sha256()
    sha256.update(first.data)
    sha256.update(second.data)
    return sha256.digest()

merkle = MerkleTreeGenerator(leaf=leaf, parent=parent)

merkle.write(b"a")
merkle.write(b"b")

assert len(merkle) == 2 + 1

Metadata

Release files for merkle-tree-stream 0.0.1a5

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

Source distribution (sdist)

Source distribution for merkle-tree-stream 0.0.1a5
File Size Uploaded Provenance
merkle-tree-stream-0.0.1a5.tar.gz 15.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for merkle-tree-stream 0.0.1a5
File Interpreter ABI Platform
merkle_tree_stream-0.0.1a5-py3-none-any.whl Python 3 none any Details

Total release size: 31.5 kB

Release files / merkle-tree-stream-0.0.1a5.tar.gz

Download URL merkle-tree-stream-0.0.1a5.tar.gz
Size 15.6 kB
Tags Source
SHA-256 checksum
How to use checksums
0ae6c9397149da08d000e53b8b8bb94373b7365ac425c5eec80cd7726135147a
BLAKE2b-256 checksum
How to use checksums
d634096b30f916b36ac1e6241d6328e8ed8b869d465b259898053475379a85f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.9 CPython/3.8.0 Linux/4.9.0-12-amd64

Release files / merkle_tree_stream-0.0.1a5-py3-none-any.whl

Download URL merkle_tree_stream-0.0.1a5-py3-none-any.whl
Size 15.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
81f486805ef15e92f37e0b59382827ad95e3a7c968a959afb353ba9831f49b23
BLAKE2b-256 checksum
How to use checksums
328fb06c466afc2717219fa8b0bb01c4a1388e7e12c098f6d1da9de254a57fa2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.9 CPython/3.8.0 Linux/4.9.0-12-amd64

Security for merkle-tree-stream 0.0.1a5

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