File: rustcrypto-sha1.patch

package info (click to toggle)
rust-uuid 1.18.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 548 kB
  • sloc: makefile: 2
file content (35 lines) | stat: -rw-r--r-- 722 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
--- a/src/sha1.rs
+++ b/src/sha1.rs
@@ -1,6 +1,6 @@
 #[cfg(feature = "v5")]
 pub(crate) fn hash(ns: &[u8], src: &[u8]) -> [u8; 16] {
-    use sha1_smol::Sha1;
+    use sha1::{Digest,Sha1};
 
     let mut hasher = Sha1::new();
 
@@ -8,7 +8,7 @@
     hasher.update(src);
 
     let mut bytes = [0; 16];
-    bytes.copy_from_slice(&hasher.digest().bytes()[..16]);
+    bytes.copy_from_slice(&hasher.finalize()[..16]);
 
     bytes
 }
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -123,1 +123,1 @@
-sha1 = ["dep:sha1_smol"]
+sha1 = ["dep:sha1"]
@@ -167,8 +167,8 @@
 optional = true
 default-features = false
 
-[dependencies.sha1_smol]
-version = "1"
+[dependencies.sha1]
+version = "0.10"
 optional = true
 default-features = false