react-native-xxhash 0.1.0 → 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 +4 -0
- package/android/CMakeLists.txt +15 -22
- package/lib/typescript/index.d.ts.map +1 -0
- package/package.json +10 -30
- package/lib/typescript/commonjs/src/index.d.ts.map +0 -1
- package/lib/typescript/module/src/index.d.ts +0 -41
- package/lib/typescript/module/src/index.d.ts.map +0 -1
- /package/lib/{typescript/commonjs → commonjs}/package.json +0 -0
- /package/lib/{typescript/module → module}/package.json +0 -0
- /package/lib/typescript/{commonjs/src/index.d.ts → index.d.ts} +0 -0
package/README.md
CHANGED
package/android/CMakeLists.txt
CHANGED
|
@@ -30,26 +30,19 @@ include_directories(
|
|
|
30
30
|
)
|
|
31
31
|
|
|
32
32
|
if (ReactAndroid_VERSION_MINOR GREATER_EQUAL 76)
|
|
33
|
-
target_link_libraries(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
)
|
|
33
|
+
target_link_libraries(
|
|
34
|
+
react-native-xxhash
|
|
35
|
+
ReactAndroid::jsi
|
|
36
|
+
log
|
|
37
|
+
ReactAndroid::reactnative
|
|
38
|
+
fbjni::fbjni
|
|
39
|
+
)
|
|
40
40
|
else()
|
|
41
|
-
target_link_libraries(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
)
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
# target_link_libraries(react-native-xxhash
|
|
51
|
-
# ReactAndroid::jsi
|
|
52
|
-
# log
|
|
53
|
-
# ReactAndroid::reactnative
|
|
54
|
-
# fbjni::fbjni
|
|
55
|
-
# )
|
|
41
|
+
target_link_libraries(
|
|
42
|
+
react-native-xxhash
|
|
43
|
+
ReactAndroid::jsi
|
|
44
|
+
log
|
|
45
|
+
ReactAndroid::reactnativejni
|
|
46
|
+
fbjni::fbjni
|
|
47
|
+
)
|
|
48
|
+
endif()
|
|
@@ -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.
|
|
4
|
-
"description": "
|
|
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
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
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
|
|
File without changes
|
|
File without changes
|