Skip to main content

Python implementation of hamt-sharding.

Project description

This code has been transpiled from js-hamt-sharding 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'

Project details


Download files

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

Source Distribution

hamt_sharding-0.1.2.tar.gz (5.3 kB view hashes)

Uploaded Source

Built Distribution

hamt_sharding-0.1.2-py3-none-any.whl (5.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page