@neko-makura/railid 1.1.0 → 1.1.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 CHANGED
@@ -8,6 +8,29 @@ npm install @neko-makura/railid
8
8
 
9
9
  The package includes prebuilt N-API binaries. Node.js 18 or newer is required.
10
10
 
11
+ ## Platforms
12
+
13
+ | Platform | Architecture | libc | Backend |
14
+ |---|---|---|---|
15
+ | Linux | x64 | glibc | TPM (`libtss2`) + OS-only fallback |
16
+ | Linux | x64 | musl | OS-only |
17
+ | Linux | arm64 | glibc | OS-only |
18
+ | Linux | arm64 | musl | OS-only |
19
+ | Linux | armv7 | glibc (hard-float) | OS-only |
20
+ | Linux | riscv64 | glibc | OS-only |
21
+ | Windows | x64 | MSVC | TPM (TBS) |
22
+ | Windows | arm64 | MSVC | TPM (TBS) |
23
+ | macOS | x64 | — | OS-only |
24
+ | macOS | arm64 | — | OS-only |
25
+
26
+ `index.js` selects the addon from `process.platform`, `process.arch` and, on
27
+ Linux, whether the Node process runs on glibc or musl.
28
+
29
+ The riscv64 addon targets the `riscv64gc` glibc ABI used by distribution Node
30
+ builds (for example Ubuntu 24.04). Node.js does not publish official riscv64
31
+ binaries; use a distribution package.
32
+
33
+
11
34
  ## Usage
12
35
 
13
36
  ```js
@@ -87,8 +110,8 @@ use the batch APIs.
87
110
 
88
111
  ## Linux and TPM
89
112
 
90
- The Linux TPM binary links against `libtss2` (`tss-esapi`). The package ships
91
- two Linux x64 binaries:
113
+ The Linux x64 glibc TPM binary links against `libtss2` (`tss-esapi`). The
114
+ package ships two Linux x64 glibc binaries:
92
115
 
93
116
  - `railid-tpm.linux-x64-gnu.node` — TPM backend; needs `libtss2`
94
117
  - `railid.linux-x64-gnu.node` — OS-only; no TSS dependency
@@ -104,6 +127,10 @@ Debian/Ubuntu TPM users need:
104
127
  sudo apt install libtss2
105
128
  ```
106
129
 
130
+ Alpine, arm64, armv7 and riscv64 ship the OS-only backend only. Those
131
+ platforms load `railid.<platform>-<arch>[-<libc>].node` directly, so `generate()`
132
+ throws `TpmUnavailable` and `generateOsOnly()` is the supported profile.
133
+
107
134
  Windows uses the system TBS service (`Tbs.dll`) and needs no extra DLL. macOS
108
135
  ships the OS-only backend.
109
136
 
@@ -116,13 +143,25 @@ Requirements:
116
143
  - Node.js 18+
117
144
 
118
145
  ```bash
119
- npm run build # platform default
146
+ npm run build # host default
120
147
  npm run build -- --os-only
148
+ npm run build -- --target linux-arm64-musl # cross target, OS-only
149
+ npm run verify # check every .node binary against its target tag
121
150
  npm test
122
151
  ```
123
152
 
124
- On Linux the default build produces both TPM and OS-only binaries. On Windows
125
- it produces the TPM binary. On macOS it produces the OS-only binary.
153
+ `node scripts/build.js --list` prints the supported targets. On Linux the
154
+ default build produces both TPM and OS-only binaries for x64; other targets
155
+ produce the OS-only binary. On Windows it produces the TPM binary. On macOS it
156
+ produces both OS-only slices.
157
+
158
+ Cross-compiling without a matching host is easiest in a container. The helper
159
+ installs the toolchain for the requested target:
160
+
161
+ ```bash
162
+ docker run --rm -v "$PWD:/src" -w /src/node rust:1.88-alpine \
163
+ sh scripts/build-in-docker.sh linux-arm64-musl
164
+ ```
126
165
 
127
166
  ## Benchmarks
128
167
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neko-makura/railid",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Native N-API bindings for RailID: 192-bit timestamp-first identifiers with TPM 2.0 + OS CSPRNG randomness",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -34,6 +34,7 @@
34
34
  ],
35
35
  "scripts": {
36
36
  "build": "node scripts/build.js",
37
+ "verify": "node scripts/verify.js",
37
38
  "test": "node test.js",
38
39
  "pack:check": "npm pack --dry-run"
39
40
  }
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file