File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
compiler/src/dotty/tools/dotc/core/tasty Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -75,18 +75,19 @@ class TastyPickler(val rootCls: ClassSymbol) {
7575
7676 /** Returns a non-cryptographic 64-bit hash of the array.
7777 *
78- * from https://en.wikipedia.org/wiki/PJW_hash_function#Implementation
78+ * from https://en.wikipedia.org/wiki/PJW_hash_function#Algorithm
7979 */
8080 private def pjwHash64 (data : Array [Byte ]): Long = {
8181 var h = 0L
8282 var i = 0
8383 while (i < data.length) {
8484 val d = data(i) & 0xFFL // Interpret byte as unsigned byte
85- h = (h << 4 ) + d
86- val high = h & 0xF0000000L
87- if (high != 0 )
88- h ^= high >> 24
89- h &= ~ high
85+ h = (h << 8 ) + d
86+ val high = h & 0xFF00000000000000L
87+ if (high != 0 ) {
88+ h ^= high >> 48L
89+ h &= ~ high
90+ }
9091 i += 1
9192 }
9293 h
You can’t perform that action at this time.
0 commit comments