Merge branch 'upgrade-deps' of jplatte/digest_auth_rs into master

This commit was merged in pull request #4.
This commit is contained in:
2021-01-23 17:40:35 +00:00
committed by Gitea
2 changed files with 6 additions and 6 deletions
+4 -4
View File
@@ -15,8 +15,8 @@ categories = [
license = "MIT" license = "MIT"
[dependencies] [dependencies]
rand = "0.7" rand = "0.8"
hex = "0.4" hex = "0.4"
sha2 = "0.8" sha2 = "0.9"
md-5 = "0.8" md-5 = "0.9"
digest = "0.8" digest = "0.9"
+2 -2
View File
@@ -37,8 +37,8 @@ impl Algorithm {
AlgorithmType::SHA2_512_256 => Box::new(Sha512Trunc256::new()), AlgorithmType::SHA2_512_256 => Box::new(Sha512Trunc256::new()),
}; };
hash.input(bytes); hash.update(bytes);
hex::encode(hash.result()) hex::encode(hash.finalize())
} }
/// Calculate a hash of string's bytes using the selected algorithm /// Calculate a hash of string's bytes using the selected algorithm