refactor: use digest method in hash util

This commit is contained in:
daimond113 2024-08-29 23:30:14 +02:00
parent 2a136f11db
commit f631c1deb9
No known key found for this signature in database
GPG key ID: 3A8ECE51328B513C

View file

@ -74,7 +74,5 @@ pub fn deserialize_git_like_url<'de, D: Deserializer<'de>>(
}
pub fn hash<S: AsRef<[u8]>>(struc: S) -> String {
let mut hasher = Sha256::new();
hasher.update(struc.as_ref());
format!("{:x}", hasher.finalize())
format!("{:x}", Sha256::digest(struc.as_ref()))
}