mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-24 09:25:15 +00:00
1 line
5.2 KiB
JSON
1 line
5.2 KiB
JSON
|
{"ast":null,"code":"/* eslint-disable */\n// Inspired by https://github.com/garycourt/murmurhash-js\n// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86\nfunction murmur2(str) {\n // 'm' and 'r' are mixing constants generated offline.\n // They're not really 'magic', they just happen to work well.\n // const m = 0x5bd1e995;\n // const r = 24;\n // Initialize the hash\n var h = 0; // Mix 4 bytes at a time into the hash\n\n var k,\n i = 0,\n len = str.length;\n\n for (; len >= 4; ++i, len -= 4) {\n k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;\n k =\n /* Math.imul(k, m): */\n (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);\n k ^=\n /* k >>> r: */\n k >>> 24;\n h =\n /* Math.imul(k, m): */\n (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n } // Handle the last few bytes of the input array\n\n\n switch (len) {\n case 3:\n h ^= (str.charCodeAt(i + 2) & 0xff) << 16;\n\n case 2:\n h ^= (str.charCodeAt(i + 1) & 0xff) << 8;\n\n case 1:\n h ^= str.charCodeAt(i) & 0xff;\n h =\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n } // Do a few final mixes of the hash to ensure the last few\n // bytes are well-incorporated.\n\n\n h ^= h >>> 13;\n h =\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n return ((h ^ h >>> 15) >>> 0).toString(36);\n}\n\nexport default murmur2;","map":{"version":3,"sources":["/app/node_modules/@emotion/hash/dist/hash.browser.esm.js"],"names":["murmur2","str","h","k","i","len","length","charCodeAt","toString"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAT,CAAiBC,GAAjB,EAAsB;AACpB;AACA;AACA;AACA;AACA;AACA,MAAIC,CAAC,GAAG,CAAR,CANoB,CAMT;;AAEX,MAAIC,CAAJ;AAAA,MACIC,CAAC,GAAG,CADR;AAAA,MAEIC,GAAG,GAAGJ,GAAG,CAACK,MAFd;;AAIA,SAAOD,GAAG,IAAI,CAAd,EAAiB,EAAED,CAAF,EAAKC,GAAG,IAAI,CAA7B,EAAgC;AAC9BF,IAAAA,CAAC,GAAGF,GAAG,CAACM,UAAJ,CAAeH,CAAf,IAAoB,IAApB,GAA2B,CAACH,GAAG,CAACM,UAAJ,CAAe,EAAEH,CAAjB,IAAsB,IAAvB,KAAgC,CAA3D,GAA+D,CAACH,GAAG,CAACM,UAAJ,CAAe,EAAEH,CAAjB,IAAsB,IAAvB,KAAgC,EAA/F,GAAoG,CAACH,GAAG,CAACM,UAAJ,CAAe,EAAEH,CAAjB,IAAsB,IAAvB,KAAgC,EAAxI;AACAD,IAAAA,CAAC;AACD;AACA,KAACA,CAAC,GAAG,MAAL,IAAe,UAAf,IAA6B,CAACA,CAAC,KAAK,EAAP,IAAa,MAAb,IAAuB,EAApD,CAFA;AAGAA,IAAAA,CAAC;AACD;AACAA,IAAAA,CAAC,KAAK,EAFN;AAGAD,IAAAA,CAAC;AACD;AACA,KAACC,CAAC,GAAG,MAAL,IAAe,UAAf,IAA6B,CAACA,CAAC,KAAK,EAAP,IAAa,MAAb,IAAuB,EAApD;AACA;AACA,KAACD,CAAC,GAAG,MAAL,IAAe,UAAf,IAA6B,CAACA,CAAC,KAAK,EAAP,IAAa,MAAb,IAAuB,EAApD,CAJA;AAKD,GAzBmB,CAyBlB;;;AAGF,UAAQG,GAAR;AACE,SAAK,CAAL;AACEH,MAAAA,CAAC,IAAI,CAACD,GAAG,CAACM,UAAJ,CAAeH,CAAC,GAAG,CAAnB,IAAwB,IAAzB,KAAkC,EAAvC;;AAEF,SAAK,CAAL;AACEF,MAAAA,CAAC,IAAI,CAACD,GAAG,CAACM,UAAJ,CAAeH,CAAC,GAAG,CAAnB,IAAwB,IAAzB,KAAkC,CAAvC;;AAEF,SAAK,CAAL;AACEF,MAAAA,CAAC,IAAID,GAAG,CAACM,UAAJ,CAAeH,CAAf,IAAoB,IAAzB;AACAF,MAAAA,CAAC;AACD;AACA,OAACA,CAAC,GAAG,MAAL,IAAe,UAAf,IAA6B,CAACA,CAAC,KAAK,EAAP,IAAa,MAAb,IAAuB,EAApD,CAFA;AATJ,GA5BoB,CAwClB;AACF;;;AAGAA,EAAAA,CAAC,IAAIA,CAAC,KAAK,EAAX;AACAA,EAAAA,CAAC;AACD;AACA,GAACA,CAAC,GAAG,MAAL,IAAe,UAAf,IAA6B,CAACA,CAAC,KAAK,EAAP,IAAa,MAAb,IAAuB,EAApD,CAFA;AAGA,SAAO,CAAC,CAACA,CAAC,GAAGA,CAAC,KAAK,EAAX,MAAmB,CAApB,EAAuBM,QAAvB,CAAgC,EAAhC,CAAP;AACD;;AAED,eAAeR,OAAf","sourcesContent":["/* eslint-disable */\n// Inspired by https://github.com/garycourt/murmurhash-js\n// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86\nfunction murmur2(str) {\n // 'm' and 'r' are mixing constants generated offline.\n // They're not really 'magic', they just happen to work well.\n // const m = 0x5bd1e995;\n // const r = 24;\n // Initialize the hash\n var h = 0; // Mix 4 bytes at a time into the hash\n\n var k,\n i = 0,\n len = str.length;\n\n for (; len
|