Philipp Krüger d24f960c53 feat: implement `PublicDirectory` conflict reconciliation (#426) 7 months ago
..
proptest-regressions af26927b09 fix: Don't drop data sometimes during re-serialization in wnfs-hamt (#348) 5 months ago
src d24f960c53 feat: implement `PublicDirectory` conflict reconciliation (#426) 5 months ago
CHANGELOG.md 15fb4c6846 chore: Release version 0.2.0 (#403) 5 months ago
Cargo.toml 15fb4c6846 chore: Release version 0.2.0 (#403) 5 months ago
README.md caac9c108f feat: make changes to BlockStore trait based on feedback (#286) 5 months ago
error.rs 082e3c8b96 refactor: separate into crates (#184) 5 months ago

README.md

:warning: Work in progress :warning:

##

This Rust crate provides an implementation of a Hash Array Mapped Trie (HAMT) based on IPLD.

HAMT is a data structure that hashes keys and uses increments of the hash at each level to determine placement of the entry or child node in the tree structure.

The number of bits used for index calculation at each level is determined by the bitWidth. Each node can hold up to 2^bitWidth elements, which are stored in an array. Entries are stored in key-sorted order in buckets. If a bucket already contains the maximum number of elements, a new child node is created and entries are inserted into the new node.

The data elements array is only allocated to store actual entries, and a map bitfield is used to determine if an index exists in the data array.

The implementation is based on fvm_ipld_hamt with some modifications for async blockstore access and immutability-by-default.

Usage

use wnfs_hamt::Node;
use wnfs_common::MemoryBlockStore;

let store = &MemoryBlockStore::default();
let scores: Node<String, usize> = Rc::new(Node::default());

scores.set("Mandy", 30, store).await?;
let result = scores.get("Mandy", store).await?;