mirror of
https://github.com/krahets/hello-algo.git
synced 2026-11-26 14:03:50 +08:00
Retranslate the complete English edition from Simplified Chinese (#2010)
* Retranslate the complete English edition from Simplified Chinese * Polish three English explanations after reader-focused review
This commit is contained in:
@@ -34,7 +34,7 @@ function xorHash(key) {
|
||||
return hash % MODULUS;
|
||||
}
|
||||
|
||||
/* Rotational hash */
|
||||
/* Rotating hash */
|
||||
function rotHash(key) {
|
||||
let hash = 0;
|
||||
const MODULUS = 1000000007;
|
||||
@@ -44,17 +44,17 @@ function rotHash(key) {
|
||||
return hash;
|
||||
}
|
||||
|
||||
/* Driver Code */
|
||||
const key = 'Hello Algo';
|
||||
/* Driver code */
|
||||
const key = 'Hello 算法';
|
||||
|
||||
let hash = addHash(key);
|
||||
console.log('Additive hash value is ' + hash);
|
||||
console.log('Additive hash value: ' + hash);
|
||||
|
||||
hash = mulHash(key);
|
||||
console.log('Multiplicative hash value is ' + hash);
|
||||
console.log('Multiplicative hash value: ' + hash);
|
||||
|
||||
hash = xorHash(key);
|
||||
console.log('XOR hash value is ' + hash);
|
||||
console.log('XOR hash value: ' + hash);
|
||||
|
||||
hash = rotHash(key);
|
||||
console.log('Rotational hash value is ' + hash);
|
||||
console.log('Rotating hash value: ' + hash);
|
||||
|
||||
Reference in New Issue
Block a user