File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 11[package ]
22name = " cargo-util"
3- version = " 0.2.3 "
3+ version = " 0.2.4 "
44edition = " 2021"
55license = " MIT OR Apache-2.0"
66homepage = " https://github.com/rust-lang/cargo"
@@ -9,7 +9,7 @@ description = "Miscellaneous support code used by Cargo."
99
1010[dependencies ]
1111anyhow = " 1.0.34"
12- crypto-hash = " 0.3.1 "
12+ sha2 = " 0.10.6 "
1313filetime = " 0.2.9"
1414hex = " 0.4.2"
1515jobserver = " 0.1.26"
Original file line number Diff line number Diff line change 11use super :: paths;
22use anyhow:: { Context , Result } ;
3- use crypto_hash :: { Algorithm , Hasher } ;
3+ use sha2 :: { Digest , Sha256 as Sha2_sha256 } ;
44use std:: fs:: File ;
5- use std:: io:: { self , Read , Write } ;
5+ use std:: io:: { self , Read } ;
66use std:: path:: Path ;
77
8- pub struct Sha256 ( Hasher ) ;
8+ pub struct Sha256 ( Sha2_sha256 ) ;
99
1010impl Sha256 {
1111 pub fn new ( ) -> Sha256 {
12- let hasher = Hasher :: new ( Algorithm :: SHA256 ) ;
12+ let hasher = Sha2_sha256 :: new ( ) ;
1313 Sha256 ( hasher)
1414 }
1515
1616 pub fn update ( & mut self , bytes : & [ u8 ] ) -> & mut Sha256 {
17- let _ = self . 0 . write_all ( bytes) ;
17+ let _ = self . 0 . update ( bytes) ;
1818 self
1919 }
2020
@@ -39,7 +39,7 @@ impl Sha256 {
3939
4040 pub fn finish ( & mut self ) -> [ u8 ; 32 ] {
4141 let mut ret = [ 0u8 ; 32 ] ;
42- let data = self . 0 . finish ( ) ;
42+ let data = self . 0 . finalize_reset ( ) ;
4343 ret. copy_from_slice ( & data[ ..] ) ;
4444 ret
4545 }
You can’t perform that action at this time.
0 commit comments