trifid/tfclient/src/util.rs

9 lines
200 B
Rust
Raw Normal View History

use sha2::Sha256;
use sha2::Digest;
pub fn sha256(bytes: &[u8]) -> String {
let mut hasher = Sha256::new();
hasher.update(bytes);
let digest = hasher.finalize();
hex::encode(digest)
}