@@ -43,7 +43,7 @@ use rustc_macros::{Decodable, Encodable, HashStable_Generic};
43
43
use rustc_serialize:: opaque:: { FileEncoder , MemDecoder } ;
44
44
use rustc_serialize:: { Decodable , Decoder , Encodable , Encoder } ;
45
45
use tracing:: debug;
46
- use twox_hash:: xxh3 :: { self , HasherExt } ;
46
+ use twox_hash:: XxHash64 ;
47
47
48
48
mod caching_source_map_view;
49
49
pub mod source_map;
@@ -1531,7 +1531,9 @@ impl SourceFileHash {
1531
1531
value. copy_from_slice ( & Sha256 :: digest ( data) ) ;
1532
1532
}
1533
1533
SourceFileHashAlgorithm :: XxHash => {
1534
- value. copy_from_slice ( & xxh3:: hash128 ( data) . to_be_bytes ( ) ) ;
1534
+ let mut hasher = XxHash64 :: with_seed ( 0 ) ;
1535
+ hasher. write ( data) ;
1536
+ value. copy_from_slice ( & hasher. finish ( ) . to_be_bytes ( ) ) ;
1535
1537
}
1536
1538
} ;
1537
1539
hash
@@ -1569,9 +1571,9 @@ impl SourceFileHash {
1569
1571
match kind {
1570
1572
SourceFileHashAlgorithm :: XxHash => {
1571
1573
digest (
1572
- xxh3 :: Hash128 :: default ( ) ,
1574
+ XxHash64 :: with_seed ( 0 ) ,
1573
1575
|h, b| h. write ( b) ,
1574
- |h, out| out. copy_from_slice ( & h. finish_ext ( ) . to_be_bytes ( ) ) ,
1576
+ |h, out| out. copy_from_slice ( & h. finish ( ) . to_be_bytes ( ) ) ,
1575
1577
src,
1576
1578
& mut buf,
1577
1579
value,
@@ -1633,7 +1635,7 @@ impl SourceFileHash {
1633
1635
SourceFileHashAlgorithm :: Md5 => 16 ,
1634
1636
SourceFileHashAlgorithm :: Sha1 => 20 ,
1635
1637
SourceFileHashAlgorithm :: Sha256 => 32 ,
1636
- SourceFileHashAlgorithm :: XxHash => 16 ,
1638
+ SourceFileHashAlgorithm :: XxHash => 8 ,
1637
1639
}
1638
1640
}
1639
1641
}
0 commit comments