9 lines
200 B
Rust
9 lines
200 B
Rust
|
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)
|
||
|
}
|