#sha-3 #hash #serialization #serde #compute #string

yanked sha3-hash

Easy-to-use SHA-3 library with Serde support

0.1.4 Jun 23, 2021
0.1.3 Jun 19, 2021
0.1.2 Jun 19, 2021
0.1.1 Jun 19, 2021
0.1.0 Jun 19, 2021

#39 in #sha-3

CC0 license

11KB
218 lines

sha3-hash

This library provides an easy-to-use SHA-3 hash type. It can be serialized and deserialized via Serde, and supports all expected operations.

Here is an example of how you might use this library to compute a SHA-3 hash:

let data = "Hello World!";
let hash = sha3_hash::Hash::hash_bytes(data.as_bytes());

// Prints: d0e47486bbf4c16acac26f8b653592973c1362909f90262877089f9c8a4536af
println!("{}", hash);

// Serializing the hash to a JSON string using `serde_json`
let json_string = serde_json::to_string(&hash).unwrap();

Adding sha3-hash to Cargo.toml:

[dependencies]
sha3-hash = "0.1"

lib.rs:

sha3-hash

This library provides an easy-to-use SHA-3 hash type. It can be serialized and deserialized via Serde, and supports all expected operations.

Here is an example of how you might use this library to compute a SHA-3 hash:

let data = "Hello World!";
let hash = sha3_hash::Hash::hash_bytes(data.as_bytes());

// Prints: d0e47486bbf4c16acac26f8b653592973c1362909f90262877089f9c8a4536af
println!("{}", hash);

// Serializing the hash to a JSON string using `serde_json`
let json_string = serde_json::to_string(&hash).unwrap();

Adding this library to Cargo.toml:

[dependencies]
sha3-hash = "0.1"

Dependencies

~1.5MB
~17K SLoC