hamt-sharding
JavaScript implementation of sharding using hash array mapped tries
Last updated 7 months ago by GitHub Actions .
Apache-2.0 OR MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install hamt-sharding 
SYNC missed versions from official npm registry.

hamt-sharding

codecov CI

JavaScript implementation of sharding using hash array mapped tries

About

A Hash Mapped Trie implementation for JavaScript.

This is used by @helia/unixfs for it's HAMT-sharded directory implementation.

Example

import { createHAMT } from 'hamt-sharding'
import crypto from 'crypto-promise'

// decide how to hash buffers made from keys, can return a Promise
const hashFn = async (buf) => {
  return crypto
    .createHash('sha256')
    .update(buf)
    .digest()
}

const bucket = createHAMT({
  hashFn: hashFn
})

await bucket.put('key', 'value')

const output = await bucket.get('key')
// output === 'value'

Install

$ npm i hamt-sharding

Browser <script> tag

Loading this module through a script tag will make it's exports available as HamtSharding in the global namespace.

<script src="https://unpkg.com/hamt-sharding/dist/index.min.js"></script>

API Docs

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Current Tags

  • 3.0.8                                ...           latest (7 months ago)

12 Versions

  • 3.0.8                                ...           7 months ago
  • 3.0.7                                ...           7 months ago
  • 3.0.6                                ...           3 years ago
  • 3.0.3                                ...           3 years ago
  • 3.0.2                                ...           4 years ago
  • 3.0.1                                ...           4 years ago
  • 3.0.0                                ...           5 years ago
  • 2.0.1                                ...           5 years ago
  • 2.0.0                                ...           6 years ago
  • 1.0.0                                ...           7 years ago
  • 0.0.2                                ...           8 years ago
  • 0.0.1                                ...           8 years ago
Downloads
Total 32
Today 0
This Week 0
This Month 23
Last Day 0
Last Week 3
Last Month 1
Dependencies (2)
Dev Dependencies (3)

© 2010 - cnpmjs.org x YWFE | Home | YWFE