@ohos-ports/node-rs-crc32-openharmony-arm64 1.10.7-beta.1
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 +3 -0
- package/crc32.openharmony-arm64.node +0 -0
- package/index.d.ts +5 -0
- package/index.js +45 -0
- package/package.json +45 -0
package/README.md
ADDED
|
Binary file
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/* auto-generated by NAPI-RS */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export declare function crc32(input: Uint8Array | string, initialState?: number | undefined | null): number
|
|
4
|
+
|
|
5
|
+
export declare function crc32c(input: Uint8Array | string, initialState?: number | undefined | null): number
|
package/index.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// prettier-ignore
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
// OpenHarmony platform loader for @node-rs/crc32 (migrated from darwin-x64 prebuilt package)
|
|
5
|
+
// Native binary compiled from source (napi-rs, crates.io node-rs-crc32) for
|
|
6
|
+
// aarch64-unknown-linux-ohos and signed with binary-sign-tool.
|
|
7
|
+
|
|
8
|
+
const { platform, arch } = process
|
|
9
|
+
let nativeBinding = null
|
|
10
|
+
const loadErrors = []
|
|
11
|
+
|
|
12
|
+
function requireNative() {
|
|
13
|
+
if (platform === 'openharmony') {
|
|
14
|
+
if (arch === 'arm64') {
|
|
15
|
+
try {
|
|
16
|
+
return require('./crc32.openharmony-arm64.node')
|
|
17
|
+
} catch (e) {
|
|
18
|
+
loadErrors.push(e)
|
|
19
|
+
}
|
|
20
|
+
try {
|
|
21
|
+
return require('@ohos-ports/node-rs-crc32-openharmony-arm64')
|
|
22
|
+
} catch (e) {
|
|
23
|
+
loadErrors.push(e)
|
|
24
|
+
}
|
|
25
|
+
} else {
|
|
26
|
+
loadErrors.push(new Error(`Unsupported architecture on openharmony: ${arch}`))
|
|
27
|
+
}
|
|
28
|
+
} else {
|
|
29
|
+
// Non-openharmony platforms still try the bundled openharmony binary first
|
|
30
|
+
// (the only binary shipped in this migrated package), then the legacy darwin one.
|
|
31
|
+
try {
|
|
32
|
+
return require('./crc32.openharmony-arm64.node')
|
|
33
|
+
} catch (e) {
|
|
34
|
+
loadErrors.push(e)
|
|
35
|
+
}
|
|
36
|
+
try {
|
|
37
|
+
return require('./crc32.darwin-x64.node')
|
|
38
|
+
} catch (e) {
|
|
39
|
+
loadErrors.push(e)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
throw new Error('Failed to load native binding:\n' + loadErrors.map((e) => String(e)).join('\n'))
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
module.exports = requireNative()
|
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ohos-ports/node-rs-crc32-openharmony-arm64",
|
|
3
|
+
"version": "1.10.7-beta.1",
|
|
4
|
+
"cpu": [
|
|
5
|
+
"arm64"
|
|
6
|
+
],
|
|
7
|
+
"main": "index.js",
|
|
8
|
+
"files": [
|
|
9
|
+
"crc32.openharmony-arm64.node",
|
|
10
|
+
"index.js",
|
|
11
|
+
"index.d.ts"
|
|
12
|
+
],
|
|
13
|
+
"description": "SIMD crc32 (OpenHarmony arm64 native build, compiled from source via napi-rs)",
|
|
14
|
+
"keywords": [
|
|
15
|
+
"NAPI",
|
|
16
|
+
"SIMD",
|
|
17
|
+
"crc32",
|
|
18
|
+
"crc32c",
|
|
19
|
+
"napi-rs",
|
|
20
|
+
"node-rs",
|
|
21
|
+
"openharmony",
|
|
22
|
+
"harmonyos"
|
|
23
|
+
],
|
|
24
|
+
"author": "LongYinan <lynweklm@gmail.com>",
|
|
25
|
+
"homepage": "https://github.com/napi-rs/node-rs",
|
|
26
|
+
"license": "MIT",
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">= 10"
|
|
29
|
+
},
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "https://github.com/ohos-ports/ohos-ports.git",
|
|
33
|
+
"directory": "ports/node-rs-crc32/1.10.7"
|
|
34
|
+
},
|
|
35
|
+
"bugs": {
|
|
36
|
+
"url": "https://github.com/ohos-ports/ohos-ports/issues"
|
|
37
|
+
},
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"registry": "https://registry.npmjs.org/",
|
|
40
|
+
"access": "public"
|
|
41
|
+
},
|
|
42
|
+
"os": [
|
|
43
|
+
"openharmony"
|
|
44
|
+
]
|
|
45
|
+
}
|