How to use the hippiehug.Nodes.Branch function in hippiehug

To help you get started, we’ve selected a few hippiehug examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github claimchain / claimchain-core / claimchain / utils / View on Github external
>>> len(serialize_object(leaf))
    >>> blob = Blob(b'content')
    >>> serialize_object(blob) == blob

    .. warning::

    There is no guarantee this is in sync with hippiehug, i.e., this
    is the serialization hippiehug employs internally. This will eventually
    move inside the hippiehug library.

    if isinstance(obj, hippiehug.Nodes.Leaf):
        return (obj.key, obj.item)
    elif isinstance(obj, hippiehug.Nodes.Branch):
        return (obj.pivot, obj.left_branch, obj.right_branch)
    elif isinstance(obj, hippiehug.Block):
        return (obj.index, obj.fingers, obj.items, obj.aux)
    elif isinstance(obj, Blob):
        return obj


A Merkle Tree implementation with a flexible storage backend.

Latest version published 5 years ago

Package Health Score

42 / 100
Full package analysis

Similar packages