aboutsummaryrefslogtreecommitdiffstats
path: root/src/auth.rs
diff options
context:
space:
mode:
authorSven-Hendrik Haase <svenstaro@gmail.com>2020-06-26 09:50:10 +0000
committerSven-Hendrik Haase <svenstaro@gmail.com>2020-06-26 09:50:20 +0000
commitffd26a7da6bbe655ff700cad83287690dd5b0227 (patch)
treef0223a4909c33b763dd64dbc0279c19594d7f92b /src/auth.rs
parentCreate FUNDING.yml (diff)
downloadminiserve-ffd26a7da6bbe655ff700cad83287690dd5b0227.tar.gz
miniserve-ffd26a7da6bbe655ff700cad83287690dd5b0227.zip
Update sha2 to 0.9
Diffstat (limited to 'src/auth.rs')
-rw-r--r--src/auth.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/auth.rs b/src/auth.rs
index 34c864c..6081a9d 100644
--- a/src/auth.rs
+++ b/src/auth.rs
@@ -83,8 +83,8 @@ pub fn compare_hash<T: Digest>(password: &str, hash: &[u8]) -> bool {
/// Get hash of a `text`
pub fn get_hash<T: Digest>(text: &str) -> Vec<u8> {
let mut hasher = T::new();
- hasher.input(text);
- hasher.result().to_vec()
+ hasher.update(text);
+ hasher.finalize().to_vec()
}
impl Middleware<crate::MiniserveConfig> for Auth {