react-native-xxhash 0.1.1 → 0.1.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/README.md CHANGED
@@ -8,6 +8,10 @@ react-native-xxhash
8
8
  npm install react-native-xxhash
9
9
  ```
10
10
 
11
+ ```sh
12
+ yarn add react-native-xxhash
13
+ ```
14
+
11
15
  ## Usage
12
16
 
13
17
 
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,CAAC,MAAM,CAAC;IACb,IAAI,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAC3C,IAAI,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CAC3C;AAcD;;;;;;;;;;;;;;;;GAgBG;AACF,eAAO,MAAM,OAAO,UAAW,MAAM,KAAG,MAUvC,CAAA;AAEF;;;;;;;;;;;;;;;;GAgBG;AAEF,eAAO,MAAM,MAAM,UAAW,MAAM,KAAG,MAUtC,CAAA"}
package/package.json CHANGED
@@ -1,22 +1,12 @@
1
1
  {
2
2
  "name": "react-native-xxhash",
3
- "version": "0.1.1",
4
- "description": "react-native-xxhash",
5
- "source": "./src/index.tsx",
3
+ "version": "0.1.2",
4
+ "description": "Fast xxHash implementation for React Native",
6
5
  "main": "./lib/commonjs/index.js",
7
6
  "module": "./lib/module/index.js",
8
- "exports": {
9
- ".": {
10
- "import": {
11
- "types": "./lib/typescript/module/src/index.d.ts",
12
- "default": "./lib/module/index.js"
13
- },
14
- "require": {
15
- "types": "./lib/typescript/commonjs/src/index.d.ts",
16
- "default": "./lib/commonjs/index.js"
17
- }
18
- }
19
- },
7
+ "types": "lib/typescript/index.d.ts",
8
+ "react-native": "src/index",
9
+ "source": "./src/index",
20
10
  "files": [
21
11
  "src",
22
12
  "lib",
@@ -50,7 +40,8 @@
50
40
  "ios",
51
41
  "android",
52
42
  "xxhash",
53
- "hash"
43
+ "hash",
44
+ "fast"
54
45
  ],
55
46
  "repository": {
56
47
  "type": "git",
@@ -164,23 +155,12 @@
164
155
  "source": "src",
165
156
  "output": "lib",
166
157
  "targets": [
167
- [
168
- "commonjs",
169
- {
170
- "esm": true
171
- }
172
- ],
173
- [
174
- "module",
175
- {
176
- "esm": true
177
- }
178
- ],
158
+ "commonjs",
159
+ "module",
179
160
  [
180
161
  "typescript",
181
162
  {
182
- "project": "tsconfig.build.json",
183
- "esm": true
163
+ "project": "tsconfig.build.json"
184
164
  }
185
165
  ]
186
166
  ]
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,CAAC,MAAM,CAAC;IACb,IAAI,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAC3C,IAAI,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CAC3C;AAcD;;;;;;;;;;;;;;;;GAgBG;AACF,eAAO,MAAM,OAAO,UAAW,MAAM,KAAG,MAUvC,CAAA;AAEF;;;;;;;;;;;;;;;;GAgBG;AAEF,eAAO,MAAM,MAAM,UAAW,MAAM,KAAG,MAUtC,CAAA"}
@@ -1,41 +0,0 @@
1
- declare global {
2
- var __xxhash128: (input: string) => string;
3
- var __xxhash64: (input: string) => string;
4
- }
5
- /**
6
- * Hashes the input string using the xxhash128 algorithm.
7
- * This function provides a fast and deterministic 128-bit hash for a given string input.
8
- *
9
- * @param {string} input - The string to hash.
10
- * @returns {string} The hashed string as a hexadecimal representation of the 128-bit hash.
11
- * @throws {Error} If the input is not provided.
12
- * @throws {Error} If the input is not of type string.
13
- *
14
- * @example
15
- * const result = hash128("hello world");
16
- * console.log(result); // Example output: "3a2b9e6a2b5e7e5a9e6a2b5e7e5a2a2"
17
- *
18
- * @description
19
- * This function uses the xxhash128 algorithm, which provides a larger hash size (128-bit) compared to xxhash64.
20
- * It is ideal for scenarios where a reduced collision risk is critical, such as in distributed systems or when hashing larger datasets.
21
- */
22
- export declare const hash128: (input: string) => string;
23
- /**
24
- * Hashes the input string using the xxhash64 algorithm.
25
- * This function provides a fast and deterministic 64-bit hash for a given string input.
26
- *
27
- * @param {string} input - The string to hash.
28
- * @returns {string} The hashed string as a hexadecimal representation of the 64-bit hash.
29
- * @throws {Error} If the input is not provided.
30
- * @throws {Error} If the input is not of type string.
31
- *
32
- * @example
33
- * const result = hash64("hello world");
34
- * console.log(result); // Example output: "9e6a2b5e7e5a2a2e"
35
- *
36
- * @description
37
- * This function uses the xxhash64 algorithm, known for its high performance and low collision rate.
38
- * It is ideal for hashing small to medium-sized strings.
39
- */
40
- export declare const hash64: (input: string) => string;
41
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,CAAC,MAAM,CAAC;IACb,IAAI,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAC3C,IAAI,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CAC3C;AAcD;;;;;;;;;;;;;;;;GAgBG;AACF,eAAO,MAAM,OAAO,UAAW,MAAM,KAAG,MAUvC,CAAA;AAEF;;;;;;;;;;;;;;;;GAgBG;AAEF,eAAO,MAAM,MAAM,UAAW,MAAM,KAAG,MAUtC,CAAA"}
File without changes