UNPKG

@volverjs/data

Version:

Repository pattern implementation with a tiny HttpClient based on Fetch API.

18 lines (17 loc) 619 B
class u { static cyrb53 = (l, a = 0) => { let t = 3735928559 ^ a, h = 1103547991 ^ a; for (let e = 0, i; e < l.length; e++) i = l.charCodeAt(e), t = Math.imul(t ^ i, 2654435761), h = Math.imul(h ^ i, 1597334677); return t = Math.imul(t ^ t >>> 16, 2246822507) ^ Math.imul(h ^ h >>> 13, 3266489909), h = Math.imul(h ^ h >>> 16, 2246822507) ^ Math.imul(t ^ t >>> 13, 3266489909), 4294967296 * (2097151 & h) + (t >>> 0); }; static djb2 = (l, a = 5381) => { let t = a; for (let h = 0; h < l.length; h++) t = t * 33 ^ l.charCodeAt(h); return t >>> 0; }; } export { u as Hash };