Skip to content

Instantly share code, notes, and snippets.

View anthonyk1225's full-sized avatar
🎯
Focusing

Anthony Keating anthonyk1225

🎯
Focusing
View GitHub Profile
function hashStringToInt(s, tableSize) {
let hash = 17;
for (let i = 0; i < s.length; i++) {
hash = (13 * hash * s.charCodeAt(i)) % tableSize;
}
return hash;
}