fix: update the implementation of simple_hash.js and .ts (#1656)

This commit is contained in:
AsaoOoo0o0o 2025-02-25 04:54:48 +08:00 committed by GitHub
parent 35c1885b3e
commit 98cd3a8076
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -31,7 +31,7 @@ function xorHash(key) {
for (const c of key) {
hash ^= c.charCodeAt(0);
}
return hash & MODULUS;
return hash % MODULUS;
}
/* 旋转哈希 */

View File

@ -31,7 +31,7 @@ function xorHash(key: string): number {
for (const c of key) {
hash ^= c.charCodeAt(0);
}
return hash & MODULUS;
return hash % MODULUS;
}
/* 旋转哈希 */