Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function simpleHash(str) {
- let hash = 0;
- for (let i = 0; i < str.length; i++) {
- hash = (hash << 5) - hash + str.charCodeAt(i);
- hash = hash >>> 0; // Convert to unsigned 32-bit
- }
- return hash;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement