Skip to content

Instantly share code, notes, and snippets.

View mhbaando's full-sized avatar
🏠
Working from home

kamaal Abshir mhbaando

🏠
Working from home
View GitHub Profile
function hashCode(str) {
let hash = 0;
for (let i = 0; i < str.length; i++) {
const char = str.charCodeAt(i);
hash = ((hash << 5) - hash) + char;
hash = hash & hash;
}
return hash;
}