SHA256 with the sha2 Crate
RustCompute a SHA256 hex digest with the sha2 crate.
// Cargo.toml: sha2 = "0.10"
use sha2::{Digest, Sha256};
fn main() {
let mut h = Sha256::new();
h.update(b"hello world");
println!("{:x}", h.finalize());
}
Compute a SHA256 hex digest with the sha2 crate.
// Cargo.toml: sha2 = "0.10"
use sha2::{Digest, Sha256};
fn main() {
let mut h = Sha256::new();
h.update(b"hello world");
println!("{:x}", h.finalize());
}