Open xinglie opened 9 months ago
let hash = (str: string, seed = 131) => {//13,131,1313,13131,etc let hash = 0, i = 0, ch; while (i < str.length) { ch = str.charCodeAt(i++); hash = (seed * hash + ch) & 0x7FFFFFFF; } return hash; };