10 releases (breaking)

new 0.8.0 Apr 27, 2021
0.7.0 Jan 25, 2021
0.6.3 Jan 21, 2021
0.6.2 Nov 10, 2020
0.4.0 Jun 10, 2020

#244 in Data structures

Download history 60/week @ 2021-01-07 19/week @ 2021-01-14 83/week @ 2021-01-21 67/week @ 2021-01-28 123/week @ 2021-02-04 184/week @ 2021-02-11 138/week @ 2021-02-18 67/week @ 2021-02-25 27/week @ 2021-03-04 59/week @ 2021-03-11 49/week @ 2021-03-18 58/week @ 2021-03-25 73/week @ 2021-04-01 19/week @ 2021-04-08 33/week @ 2021-04-15 84/week @ 2021-04-22

301 downloads per month
Used in 2 crates (via dusk-poseidon)

MPL-2.0 license

14KB
325 lines

nstack

nstack is a stack-like merkle datastructure for storing and accessing indexed values.

Operations supported are add and remove at the end of the structure, and mutable access to indexed leaves.

Usage example


use kelvin::{annotations::Cardinality, Blake2b};

let n: usize = 256;
let mut nt = NStack::<_, Cardinality<u64>, Blake2b>::new();

for i in 0..n {
    nt.push(i).unwrap();
}

// get a mutable reference to the 128'th element

let element = &mut *nt.get_mut(128).unwrap().unwrap();


lib.rs:

NStack

A stack datastructure with indexed lookup.

Dependencies

~0.8–1.4MB
~30K SLoC