mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-30 22:22:02 +02:00
9 lines
218 B
Rust
9 lines
218 B
Rust
use sha2::{Digest, Sha256};
|
|
|
|
pub(crate) fn compute_checksum(bytes: impl AsRef<[u8]>) -> String {
|
|
let mut hasher = Sha256::new();
|
|
hasher.update(&bytes);
|
|
let hash = hasher.finalize();
|
|
hex::encode(hash)
|
|
}
|