Metadata-Version: 2.1
Name: hamt_sharding
Version: 0.1.2
Summary: Python implementation of hamt-sharding.
Home-page: https://github.com/kralverde/py-hamt-sharding/
Author: kralverde
Project-URL: Bug Tracker, https://github.com/kralverde/py-hamt-sharding/issues
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.7
Classifier: Operating System :: OS Independent
Classifier: Natural Language :: English
Classifier: Typing :: Typed
Requires-Python: >=3.7
Description-Content-Type: text/x-rst
Requires-Dist: attrs>=20.1.0
Requires-Dist: bitmap_sparse_array>=0.1.2

This code has been transpiled from `js-hamt-sharding <https://github.com/ipfs/js-hamt-sharding/commit/a993a1e5a3dc234b118a4a32974478d3ba632af9>`_ and has minimal changes. 

Usage
-----

HAMTBucket implements `MutableMapping`.

We suggest you import the HAMTBucket as follows:

>>> from hamt_sharding import HAMTBucket

Setting and getting
^^^^^^^^^^^^^^^^^^^

>>> from hashlib import sha256
>>> def hash_fn(value: bytes):
...     return sha256(value).digest()
...
>>> bucket = HAMTBucket.create_hamt(hash_fn)
>>> bucket['key'] = 'value'
>>> bucket['key']
'value'

