5 releases (3 breaking)

0.4.0 Jun 21, 2022
0.3.1 Dec 13, 2017
0.3.0 Nov 30, 2017
0.2.0 Nov 25, 2017
0.1.0 Nov 22, 2017

#6 in #hashable

Download history 90/week @ 2023-12-07 104/week @ 2023-12-14 44/week @ 2023-12-21 43/week @ 2023-12-28 55/week @ 2024-01-04 105/week @ 2024-01-11 125/week @ 2024-01-18 41/week @ 2024-01-25 69/week @ 2024-02-01 70/week @ 2024-02-08 47/week @ 2024-02-15 92/week @ 2024-02-22 176/week @ 2024-02-29 147/week @ 2024-03-07 140/week @ 2024-03-14 70/week @ 2024-03-21

544 downloads per month

BSD-3-Clause

49KB
880 lines

merkle_light_derive

Build Status Issues License Crates.io

merkle_light_derive is a #[derive(Hashable)] helper implementation for the merkle_light, a lightweight Rust implementation of a Merkle tree.

Documentation

Documentation is available.

Quick start

extern crate merkle_light;

#[macro_use]
extern crate merkle_light_derive;

use std::collections::hash_map::DefaultHasher;
use std::hash::Hasher;
use merkle_light::hash::Hashable;

#[derive(Hashable, Debug)]
struct Foo {
    a: u8,
    b: u16,
    c: u32,
    d: u64,
    e: String,
    f: &'static str,
}

fn main() {
    let foo = Foo {
        a: 1,
        b: 2,
        c: 3,
        d: 4,
        e: String::from("bar"),
        f: "bar",
    };

    let hr = &mut DefaultHasher::new();
    println!("{}, foo.hash(hr));
}

Bug Reporting

Please report bugs either as pull requests or as issues in the issue tracker. merkle has a full disclosure vulnerability policy. Please do NOT attempt to report any security vulnerability in this code privately to anybody.

License

See LICENSE.

Dependencies

~1.5MB
~40K SLoC