File tree Expand file tree Collapse file tree 1 file changed +1
-14
lines changed Expand file tree Collapse file tree 1 file changed +1
-14
lines changed Original file line number Diff line number Diff line change 1
- use sha1_checked:: CollisionResult ;
2
-
3
- /// A hash-digest produced by a [`Hasher`] hash implementation.
4
- pub type Digest = [ u8 ; 20 ] ;
1
+ use sha1_checked:: { CollisionResult , Digest } ;
5
2
6
3
/// The error returned by [`Hasher::try_finalize()`].
7
4
#[ derive( Debug , thiserror:: Error ) ]
@@ -32,7 +29,6 @@ impl Default for Hasher {
32
29
impl Hasher {
33
30
/// Digest the given `bytes`.
34
31
pub fn update ( & mut self , bytes : & [ u8 ] ) {
35
- use sha1_checked:: Digest ;
36
32
self . 0 . update ( bytes) ;
37
33
}
38
34
@@ -67,15 +63,6 @@ impl Hasher {
67
63
pub fn finalize ( self ) -> crate :: ObjectId {
68
64
self . try_finalize ( ) . expect ( "Detected SHA-1 collision attack" )
69
65
}
70
-
71
- /// Finalize the hash and produce a digest.
72
- #[ inline]
73
- pub fn digest ( self ) -> Digest {
74
- self . finalize ( )
75
- . as_slice ( )
76
- . try_into ( )
77
- . expect ( "SHA-1 object ID to be 20 bytes long" )
78
- }
79
66
}
80
67
81
68
/// Produce a hasher suitable for the given kind of hash.
You can’t perform that action at this time.
0 commit comments