Over the years we accrued many spelling mistakes in the code base. This PR attempts to fix spelling mistakes and typos in all areas of the code that are extremely safe to change - comments - test descriptions - other low risk areas
12 lines
295 B
JavaScript
12 lines
295 B
JavaScript
/*eslint no-bitwise:0 */
|
|
|
|
// Note: before changing this be aware the same algorithm is used server side for avatars.
|
|
export function hashString(str) {
|
|
let hash = 0;
|
|
for (let i = 0; i < str.length; i++) {
|
|
hash = (hash << 5) - hash + str.charCodeAt(i);
|
|
hash |= 0;
|
|
}
|
|
return hash;
|
|
}
|