UNPKG

mutoid

Version:

Reactive library for data fetching, caching, state management

10 lines (9 loc) 303 B
export const hashString = (s) => { let h = 0xdeadbeef; for (let i = 0; i < s.length; i++) { // eslint-disable-next-line no-bitwise h = Math.imul(h ^ s.charCodeAt(i), 2654435761); } // eslint-disable-next-line no-bitwise return ((h ^ (h >>> 16)) >>> 0).toString(); };