#digest #hashing #structures #sha-256

no-std hashing-serializer

Serialize serde-implementing structures directly into a hash

3 unstable releases

0.2.0-pre.0 Aug 1, 2024
0.1.1 Jun 12, 2024
0.1.0 Jun 12, 2024

#105 in No standard library

Download history 319/week @ 2024-08-18 358/week @ 2024-08-25 67/week @ 2024-09-01 308/week @ 2024-09-08 445/week @ 2024-09-15 545/week @ 2024-09-22 557/week @ 2024-09-29 176/week @ 2024-10-06 195/week @ 2024-10-13 429/week @ 2024-10-20 222/week @ 2024-10-27 268/week @ 2024-11-03 217/week @ 2024-11-10 333/week @ 2024-11-17 323/week @ 2024-11-24 496/week @ 2024-12-01

1,370 downloads per month
Used in 13 crates (via synedrion)

MIT license

15KB
336 lines

crate Docs License Coverage

An implementation of serde::Serializer serializing directly into a hash digest (anything implementing digest::Update).

use digest::Digest;
use k256::ecdsa::SigningKey;
use rand_core::OsRng;
use serde::Serialize;
use sha2::Sha256;

use hashing_serializer::HashingSerializer;

let sk = SigningKey::random(&mut OsRng);
let vk = sk.verifying_key();

let mut digest = Sha256::new();
let serializer = HashingSerializer { digest: &mut digest };
vk.serialize(serializer).unwrap();

Dependencies

~405–670KB
~16K SLoC