rs_sha3_512 0.1.0

`rs_sha3_512` is a Rust implementation of the SHA3-512 cryptographic hash algorithm, part of the larger `rs_ssl` project. This package provides SHA3-512 hashing functionality in a standalone manner, ideal for when only SHA3-512 is required. Alternatively, for those seeking a comprehensive set of cryptographic functions, this same algorithm is included within the broader `rs_ssl` library bundle. The focus of `rs_sha3_512` and the larger project is on performance, safety, and openness, with a commitment to ongoing maintenance and enhancement.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
extern crate alloc;

use crate::Sha3_512State;
use alloc::format;
use core::hash::{BuildHasher, Hasher};
use rs_hasher_ctx_lib::HasherContext;

#[test]
fn assert_empty_string_hash_correctness() {
    let sha3_512state = Sha3_512State::default();
    let mut sha3_512hasher = sha3_512state.build_hasher();

    sha3_512hasher.write(b"");

    let output = HasherContext::finish(&mut sha3_512hasher);

    assert_eq!(format!("{output:02x}"), "a69f73cca23a9ac5c8b567dc185a756e97c982164fe25859e0d1dcc1475c80a615b2123af1f5f94c11e3e9402c3ac558f500199d95b6d3e301758586281dcd26");
}