SHA-384 rs-sha384 - Secure Hash Algorithm 384
The SHA-384 hash function is part of the SHA-2 family, which was developed by the National Institute of Standards and Technology (NIST). SHA-384 provides a higher level of security than SHA-1 and SHA-256, producing a 384-bit hash from input data.
Usage
The crate provides a simple and intuitive API. Users can create a new SHA-384 hasher instance, update it with input data, and finalize to get the resultant hash.
Example
Here is an example of how to use the SHA-384 hash function in Rust:
# use ;
# use Sha384State;
let mut sha384hasher = default.build_hasher;
sha384hasher.write;
let result = sha384hasher.finish;
assert_eq!;
Or, as a HashSet:
# use ;
# use Sha384Hasher;
let hello = "hello";
let mut sha384hasher1 = default;
let mut sha384hasher2 = default;
let mut sha384hasher3 = default;
sha384hasher1.write;
hello.hash;
sha384hasher3.write;
sha384hasher3.write;
let u64result1 = sha384hasher1.finish;
let u64result2 = sha384hasher2.finish;
let u64result3 = sha384hasher3.finish;
assert_eq!;
assert_eq!;
assert_eq!;
assert_ne!;
Use Cases
SHA-384 is recommended for most cryptographic security applications and is commonly used in various fields such as:
- Digital signatures and certificate authorities which require a higher level of security.
- Cryptographic hardware and software standards that require a strong hash function.
NIST recommends the use of SHA-384 for security functions due to its resistance to collision attacks and its higher security level than SHA-1 and SHA-256. SHA-384 is thus widely used and considered safe for cryptographic and even most non-cryptographic functions