3 unstable releases
0.2.0-pre.0 | Aug 1, 2024 |
---|---|
0.1.1 | Jun 12, 2024 |
0.1.0 | Jun 12, 2024 |
#103 in No standard library
1,155 downloads per month
Used in 6 crates
(via synedrion)
15KB
336 lines
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