mirror of
https://github.com/pesde-pkg/pesde.git
synced 2025-01-05 23:59:09 +00:00
refactor: use digest method in hash util
This commit is contained in:
parent
2a136f11db
commit
f631c1deb9
1 changed files with 1 additions and 3 deletions
|
@ -74,7 +74,5 @@ pub fn deserialize_git_like_url<'de, D: Deserializer<'de>>(
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn hash<S: AsRef<[u8]>>(struc: S) -> String {
|
pub fn hash<S: AsRef<[u8]>>(struc: S) -> String {
|
||||||
let mut hasher = Sha256::new();
|
format!("{:x}", Sha256::digest(struc.as_ref()))
|
||||||
hasher.update(struc.as_ref());
|
|
||||||
format!("{:x}", hasher.finalize())
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue