| Crates.io | merkle_light_derive |
| lib.rs | merkle_light_derive |
| version | 0.4.0 |
| created_at | 2017-11-22 08:11:31.481796+00 |
| updated_at | 2022-06-21 08:37:58.811927+00 |
| description | #[derive(Hashable)] for light merkle tree Hashable |
| homepage | https://github.com/sitano/merkle_light |
| repository | https://github.com/sitano/merkle_light |
| max_upload_size | |
| id | 40215 |
| size | 6,954 |
merkle_light_derive is a #[derive(Hashable)] helper implementation for the merkle_light,
a lightweight Rust implementation of a Merkle tree.
Documentation is available.
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));
}
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.
See LICENSE.