@alwatr/cyrb53 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +2 -2
- package/dist/main.js.map +1 -1
- package/package.json +4 -4
package/dist/main.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* 📦 @alwatr/cyrb53 v2.0.
|
|
1
|
+
/* 📦 @alwatr/cyrb53 v2.0.2 */
|
|
2
2
|
function F(C,D=0){let j=3735928559^D,k=1103547991^D;for(let z=0,B;z<C.length;z++)B=C.charCodeAt(z),j=Math.imul(j^B,2654435761),k=Math.imul(k^B,1597334677);return j=Math.imul(j^j>>>16,2246822507),j^=Math.imul(k^k>>>13,3266489909),k=Math.imul(k^k>>>16,2246822507),k^=Math.imul(j^j>>>13,3266489909),4294967296*(2097151&k)+(j>>>0)}export{F as cyrb53};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=738E2E148344AE4A64756E2164756E21
|
|
5
5
|
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
CHANGED
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"const H1_SEED = 0xdeadbeef;\nconst H2_SEED = 0x41c6ce57;\nconst M_K1 = 2654435761;\nconst M_K2 = 1597334677;\nconst F_K1 = 2246822507;\nconst F_K2 = 3266489909;\nconst P_K1 = 4294967296; // 2^32\nconst P_K2 = 2097151; // 2^21 - 1\n\n/**\n * cyrb53: A modern, high-quality, and fast 53-bit string hash function.\n *\n * Excellent collision resistance due to its large output space.\n * The best choice for new general-purpose hashing needs in JS/TS.\n *\n * @param str The input string.\n * @param seed An optional seed value.\n * @returns A 53-bit hash number.\n *\n * @example\n * ```ts\n * const hash = cyrb53('some string');\n * ```\n */\nexport function cyrb53(str: string, seed = 0): number {\n let h1 = H1_SEED ^ seed;\n let h2 = H2_SEED ^ seed;\n\n for (let i = 0, ch; i < str.length; i++) {\n ch = str.charCodeAt(i);\n h1 = Math.imul(h1 ^ ch, M_K1);\n h2 = Math.imul(h2 ^ ch, M_K2);\n }\n\n h1 = Math.imul(h1 ^ (h1 >>> 16), F_K1);\n h1 ^= Math.imul(h2 ^ (h2 >>> 13), F_K2);\n h2 = Math.imul(h2 ^ (h2 >>> 16), F_K1);\n h2 ^= Math.imul(h1 ^ (h1 >>> 13), F_K2);\n\n return P_K1 * (P_K2 & h2) + (h1 >>> 0);\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": ";AAwBO,SAAS,CAAM,CAAC,EAAa,EAAO,EAAW,CACpD,IAAI,EAzBU,WAyBK,EACf,EAzBU,WAyBK,EAEnB,QAAS,EAAI,EAAG,EAAI,EAAI,EAAI,OAAQ,IAClC,EAAK,EAAI,WAAW,CAAC,EACrB,EAAK,KAAK,KAAK,EAAK,EA5BX,UA4BmB,EAC5B,EAAK,KAAK,KAAK,EAAK,EA5BX,UA4BmB,EAQ9B,OALA,EAAK,KAAK,KAAK,EAAM,IAAO,GA9BjB,UA8B0B,EACrC,GAAM,KAAK,KAAK,EAAM,IAAO,GA9BlB,UA8B2B,EACtC,EAAK,KAAK,KAAK,EAAM,IAAO,GAhCjB,UAgC0B,EACrC,GAAM,KAAK,KAAK,EAAM,IAAO,GAhClB,UAgC2B,EA/B3B,YACA,QAgCW,IAAO,IAAO",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "738E2E148344AE4A64756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alwatr/cyrb53",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "A modern, high-quality, and fast 53-bit string hash function.",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"author": "S. Ali Mihandoost <ali.mihandoost@gmail.com>",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"@alwatr/nano-build": "7.0.1",
|
|
24
24
|
"@alwatr/prettier-config": "7.0.1",
|
|
25
25
|
"@alwatr/tsconfig-base": "8.0.0",
|
|
26
|
-
"@alwatr/type-helper": "8.0.
|
|
27
|
-
"typescript": "^
|
|
26
|
+
"@alwatr/type-helper": "8.0.2",
|
|
27
|
+
"typescript": "^6.0.2"
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
30
|
"b": "bun run build",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"string"
|
|
59
59
|
],
|
|
60
60
|
"prettier": "@alwatr/prettier-config",
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "95bb13efd0a5f485c6b09f1a911b99492017aed1"
|
|
62
62
|
}
|