#merkle #merkle-tree

macro merkle_light_derive

#[derive(Hashable)] for light merkle tree Hashable

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

#1534 in Cryptography

Download history 18/week @ 2023-01-24 19/week @ 2023-01-31 9/week @ 2023-02-07 16/week @ 2023-02-14 15/week @ 2023-02-21 24/week @ 2023-02-28 12/week @ 2023-03-07 73/week @ 2023-03-14 55/week @ 2023-03-21 101/week @ 2023-03-28 28/week @ 2023-04-04 30/week @ 2023-04-11 56/week @ 2023-04-18 47/week @ 2023-04-25 33/week @ 2023-05-02 71/week @ 2023-05-09

208 downloads per month

BSD-3-Clause

47KB
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
~38K SLoC