mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-06 14:27:26 +08:00
fix: update the implementation of simple_hash.js and .ts (#1656)
This commit is contained in:
@ -31,7 +31,7 @@ function xorHash(key: string): number {
|
||||
for (const c of key) {
|
||||
hash ^= c.charCodeAt(0);
|
||||
}
|
||||
return hash & MODULUS;
|
||||
return hash % MODULUS;
|
||||
}
|
||||
|
||||
/* 旋转哈希 */
|
||||
|
Reference in New Issue
Block a user