File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed
Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -256,11 +256,10 @@ pub fn hash_calculator<R: BufRead>(
256256 }
257257
258258 match algorithm {
259- SupportedAlgorithm :: XXHASH32 => return Ok ( format ! ( "0x{:0>8x}" , hasher. finish( ) ) ) ,
260- SupportedAlgorithm :: XXHASH64 | SupportedAlgorithm :: XXHASH3_64 => {
261- return Ok ( format ! ( "0x{:0>16x}" , hasher. finish( ) ) )
262- }
263- _ => Ok ( format ! ( "0x{:0>32x}" , 0 ) ) , // Unreachable, wait for xxhash3_128.
259+ SupportedAlgorithm :: XXHASH32 => return Ok ( format ! ( "{:0>8x}" , hasher. finish( ) ) ) ,
260+ SupportedAlgorithm :: XXHASH64 => return Ok ( format ! ( "{:0>16x}" , hasher. finish( ) ) ) ,
261+ SupportedAlgorithm :: XXHASH3_64 => return Ok ( format ! ( "XXH3_{:0>16x}" , hasher. finish( ) ) ) ,
262+ _ => Ok ( format ! ( "{:0>32x}" , 0 ) ) , // Unreachable, wait for xxhash3_128.
264263 }
265264 } else {
266265 // hashes backend
Original file line number Diff line number Diff line change @@ -55,11 +55,9 @@ pub fn detect_hash_algorithm<S: AsRef<str>>(hash: S) -> Result<Vec<SupportedAlgo
5555 ] ) ,
5656 96 => Ok ( vec ! [ SupportedAlgorithm :: SHA384 ] ) ,
5757 128 => Ok ( vec ! [ SupportedAlgorithm :: SHA512 ] ) ,
58- 10 => Ok ( vec ! [ SupportedAlgorithm :: XXHASH32 ] ) ,
59- 18 => Ok ( vec ! [
60- SupportedAlgorithm :: XXHASH64 ,
61- SupportedAlgorithm :: XXHASH3_64 ,
62- ] ) ,
58+ 8 => Ok ( vec ! [ SupportedAlgorithm :: XXHASH32 ] ) ,
59+ 16 => Ok ( vec ! [ SupportedAlgorithm :: XXHASH64 ] ) ,
60+ 21 => Ok ( vec ! [ SupportedAlgorithm :: XXHASH3_64 ] ) ,
6361 32 => Ok ( vec ! [
6462 SupportedAlgorithm :: MD5 ,
6563 SupportedAlgorithm :: MD4 ,
You can’t perform that action at this time.
0 commit comments