Beispiel
@napi-rs/lzma-linux-x64-gnu 1.5.1: lzma, xz, lzma2
Verifiziertes Beispiel für npm @napi-rs/lzma-linux-x64-gnu 1.5.1: lzma, xz, lzma2. Der Vertrag lief auf node 22 · linux debian/x64 · docker und bestand…
sha256:e7e801f4b14824a9400e1935030585fec71c02f3c0fb974a417620d2bd04dfba
Dieses Netzwerk bietet eine Sache: ein Sample, das baut. Es hat es in einer Sandbox ausgeführt und die signierte Quittung behalten. Es bewertet nichts und garantiert nichts — ob derselbe Code bei Ihnen baut, hat es nicht gemessen.
Wie viele verschiedene Signaturschlüssel eine bestandene Vertragsquittung eingereicht haben. Einer ist der Autor allein; mehr als einer heißt, jemand anderes hat es auch gebaut. Ein Schlüssel wird selbst erzeugt und hat keine registrierte Identität dahinter — gezählt werden Schlüssel, nicht Personen.
MIT-0
Ausführungsbelege
Die deklarierte Umgebung und die signierten Läufe stehen getrennt, damit Sie genau sehen, was dieses Sample ausgeführt hat und wo.
- Beleggrundlage
- Signierter Vertrag bestanden
- Verifizierungsbelege
- 4
- Signaturschlüssel, die es gebaut haben
- 1
Deklarierte Umgebung
node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm
Umgebungen der Verifizierungsläufe
| Umgebung | Contract | Stufen | Lauf |
|---|---|---|---|
| node 22 · linux alpine/x64 · docker ed25519:c1973797be207ac4 | FAIL | compile:SKIPPED · contract:FAIL · load:SKIPPED · resolve:PASS CONTAINER_RUN · node-typescript@1 |
2026-08-20 |
| node 22 · linux alpine/x64 · docker ed25519:d91480838ac982c9 | FAIL | compile:SKIPPED · contract:FAIL · load:SKIPPED · resolve:PASS CONTAINER_RUN · node-typescript@1 |
2026-08-20 |
| node 22 · linux alpine/x64 · docker ed25519:c1973797be207ac4 | FAIL | compile:SKIPPED · contract:FAIL · load:SKIPPED · resolve:PASS CONTAINER_RUN · node-typescript@1node:22-alpine@sha256:c610fcdfb1d5… |
2026-08-31 |
| node 22 · linux debian/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · node-typescript@1node:22@sha256:8a34c4ab3ea2… |
2026-08-31 |
Fall
HOW- Ziel
- verify pkg:npm/%40napi-rs/lzma-linux-x64-gnu@1.5.1
- Symbole
-
- lzma
- xz
- lzma2
- Umgebung
- node 22.23.2
- Erstellt
- 2026-08-20T17:32:54Z
Contract
- lzma.compressSync and lzma.decompressSync round-trip Buffer synchronously
- lzma.compress and lzma.decompress round-trip Buffer asynchronously
- xz.compressSync and xz.decompressSync round-trip Buffer synchronously
- xz.compress and xz.decompress round-trip Buffer asynchronously
- lzma2.compressSync and lzma2.decompressSync round-trip Buffer synchronously
- lzma2.compress and lzma2.decompress round-trip Buffer asynchronously
Dateien
- PROMPT.md
- csx.json
- index.js
- package-lock.json
- package.json
- spec.json
- test/contract.js
Quelltext
Clean-room public code sample — generation instructions
Write a brand-new, minimal, self-contained code sample in this clean-room directory.
Do not copy, paraphrase, or reference any existing project source. Work only from this spec.
A csx.json manifest scaffold already exists. Do not recreate it from memory. Preserve its case.goal, packages and symbols; fill its empty case.contract with exact assertions and correct its environment, commands and verifierAdapter for the files you generate.
Goal: verify pkg:npm/%40napi-rs/lzma-linux-x64-gnu@1.5.1
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/%40napi-rs/lzma-linux-x64-gnu@1.5.1
Constraints:
- executionContext: node
Required runtime conditions:
- ecosystem: npm
- language: javascript
- moduleSystem: cjs
- runtime: node@22.23.2
Rules:
- One focused purpose; the smallest project that proves the goal.
- Include a contract test (test/contract.*) that runs OFFLINE and exits 0 exactly when the goal behavior works.
- Pin every dependency with a lockfile so resolution is reproducible.
- No secrets, credentials, or tokens. No real URLs (only example.com or localhost). No absolute paths.
- No personal names, emails, company names, or project identifiers of any kind.
- No binaries and no generated output (node_modules, dist, target, venv, .git, .env).
- Keep it under 200 files and 256KB packed.
{"case":{"caseId":"case:sha256:d26b53276822b2926f059a44128edf7adccb40dd6cfcd3dd664e4d9a2537ff30","constraints":{"executionContext":"node"},"contract":["lzma.compressSync and lzma.decompressSync round-trip Buffer synchronously","lzma.compress and lzma.decompress round-trip Buffer asynchronously","xz.compressSync and xz.decompressSync round-trip Buffer synchronously","xz.compress and xz.decompress round-trip Buffer asynchronously","lzma2.compressSync and lzma2.decompressSync round-trip Buffer synchronously","lzma2.compress and lzma2.decompress round-trip Buffer asynchronously"],"goal":"verify pkg:npm/%40napi-rs/lzma-linux-x64-gnu@1.5.1","kind":"HOW","packages":["pkg:npm/%40napi-rs/lzma-linux-x64-gnu@1.5.1"],"schemaVersion":1,"symbols":["lzma","xz","lzma2"]},"contractCommand":["node","test/contract.js"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"npm","executionContext":"node","language":"javascript","libc":"glibc","libcVersion":"2.39","moduleSystem":"cjs","os":"linux","osVersionBucket":"24","packageManager":"npm","runtime":"node","runtimeVersion":"22.23.2","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/%40napi-rs/lzma-linux-x64-gnu@1.5.1"],"schemaVersion":1,"subject":"pkg:npm/%40napi-rs/lzma-linux-x64-gnu@1.5.1","symbols":["lzma","xz","lzma2"],"verifierAdapter":"node-typescript@1"}
const os = require('node:os');
const fs = require('node:fs');
// Ensure glibc symbols are available if running in musl-based container with gcompat
const gcompatPaths = ['/lib/libgcompat.so.0', '/usr/lib/libgcompat.so.0'];
for (const p of gcompatPaths) {
if (fs.existsSync(p)) {
try {
const mod = { exports: {} };
const flags = (os.constants.dlopen?.RTLD_NOW || 2) | (os.constants.dlopen?.RTLD_GLOBAL || 256);
process.dlopen(mod, p, flags);
} catch {
// Shared libraries without Node-API exports throw on registration, but their symbols are loaded globally
}
break;
}
}
const { lzma, xz, lzma2 } = require('@napi-rs/lzma-linux-x64-gnu');
function compressLzmaSync(buffer) {
return lzma.compressSync(buffer);
}
function decompressLzmaSync(buffer) {
return lzma.decompressSync(buffer);
}
async function compressLzma(buffer) {
return await lzma.compress(buffer);
}
async function decompressLzma(buffer) {
return await lzma.decompress(buffer);
}
function compressXzSync(buffer) {
return xz.compressSync(buffer);
}
function decompressXzSync(buffer) {
return xz.decompressSync(buffer);
}
async function compressXz(buffer) {
return await xz.compress(buffer);
}
async function decompressXz(buffer) {
return await xz.decompress(buffer);
}
function compressLzma2Sync(buffer) {
return lzma2.compressSync(buffer);
}
function decompressLzma2Sync(buffer) {
return lzma2.decompressSync(buffer);
}
async function compressLzma2(buffer) {
return await lzma2.compress(buffer);
}
async function decompressLzma2(buffer) {
return await lzma2.decompress(buffer);
}
module.exports = {
lzma,
xz,
lzma2,
compressLzmaSync,
decompressLzmaSync,
compressLzma,
decompressLzma,
compressXzSync,
decompressXzSync,
compressXz,
decompressXz,
compressLzma2Sync,
decompressLzma2Sync,
compressLzma2,
decompressLzma2,
};
{
"name": "sample",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample",
"version": "1.0.0",
"dependencies": {
"@napi-rs/lzma-linux-x64-gnu": "1.5.1"
}
},
"node_modules/@napi-rs/lzma-linux-x64-gnu": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/@napi-rs/lzma-linux-x64-gnu/-/lzma-linux-x64-gnu-1.5.1.tgz",
"integrity": "sha512-oTXEIha4SsuXdTA4Iyskj0kpdx2yVXdhd75c2v3xGrHFfVMsbhTPZU/nMPL4sWKo4pBHm3aucLaqGlF696dTyQ==",
"cpu": [
"x64"
],
"license": "MIT",
"os": [
"linux"
],
"engines": {
"node": "^22.20 || ^24.12 || >=25"
}
}
}
}
{
"name": "sample",
"version": "1.0.0",
"description": "Minimal sample for @napi-rs/lzma-linux-x64-gnu compression",
"main": "index.js",
"type": "commonjs",
"dependencies": {
"@napi-rs/lzma-linux-x64-gnu": "1.5.1"
}
}
{
"schemaVersion": 1,
"goal": "verify pkg:npm/%40napi-rs/lzma-linux-x64-gnu@1.5.1",
"kind": "HOW",
"packages": [
"pkg:npm/%40napi-rs/lzma-linux-x64-gnu@1.5.1"
],
"constraints": {
"executionContext": "node"
},
"runtimeConditions": {
"ecosystem": "npm",
"language": "javascript",
"moduleSystem": "cjs",
"runtime": "node@22.23.2"
}
}
const assert = require('node:assert');
const {
compressLzmaSync,
decompressLzmaSync,
compressLzma,
decompressLzma,
compressXzSync,
decompressXzSync,
compressXz,
decompressXz,
compressLzma2Sync,
decompressLzma2Sync,
compressLzma2,
decompressLzma2,
} = require('../index.js');
async function run() {
const payload = 'CodeSampleX lzma compression verification payload';
const original = Buffer.from(payload, 'utf8');
// Contract 1: lzma.compressSync and lzma.decompressSync round-trip Buffer synchronously
const lzmaSyncComp = compressLzmaSync(original);
assert(Buffer.isBuffer(lzmaSyncComp), 'compressSync must return a Buffer');
assert(lzmaSyncComp.length > 0, 'Compressed buffer must not be empty');
const lzmaSyncDecomp = decompressLzmaSync(lzmaSyncComp);
assert(Buffer.isBuffer(lzmaSyncDecomp), 'decompressSync must return a Buffer');
assert.strictEqual(lzmaSyncDecomp.toString('utf8'), payload, 'lzma sync decompressed text must match original');
// Contract 2: lzma.compress and lzma.decompress round-trip Buffer asynchronously
const lzmaAsyncComp = await compressLzma(original);
assert(Buffer.isBuffer(lzmaAsyncComp), 'compress must resolve to a Buffer');
assert(lzmaAsyncComp.length > 0, 'Async compressed buffer must not be empty');
const lzmaAsyncDecomp = await decompressLzma(lzmaAsyncComp);
assert(Buffer.isBuffer(lzmaAsyncDecomp), 'decompress must resolve to a Buffer');
assert.strictEqual(lzmaAsyncDecomp.toString('utf8'), payload, 'lzma async decompressed text must match original');
// Contract 3: xz.compressSync and xz.decompressSync round-trip Buffer synchronously
const xzSyncComp = compressXzSync(original);
assert(Buffer.isBuffer(xzSyncComp), 'xz compressSync must return a Buffer');
assert(xzSyncComp.length > 0, 'xz compressed buffer must not be empty');
const xzSyncDecomp = decompressXzSync(xzSyncComp);
assert(Buffer.isBuffer(xzSyncDecomp), 'xz decompressSync must return a Buffer');
assert.strictEqual(xzSyncDecomp.toString('utf8'), payload, 'xz sync decompressed text must match original');
// Contract 4: xz.compress and xz.decompress round-trip Buffer asynchronously
const xzAsyncComp = await compressXz(original);
assert(Buffer.isBuffer(xzAsyncComp), 'xz compress must resolve to a Buffer');
assert(xzAsyncComp.length > 0, 'xz async compressed buffer must not be empty');
const xzAsyncDecomp = await decompressXz(xzAsyncComp);
assert(Buffer.isBuffer(xzAsyncDecomp), 'xz decompress must resolve to a Buffer');
assert.strictEqual(xzAsyncDecomp.toString('utf8'), payload, 'xz async decompressed text must match original');
// Contract 5: lzma2.compressSync and lzma2.decompressSync round-trip Buffer synchronously
const lzma2SyncComp = compressLzma2Sync(original);
assert(Buffer.isBuffer(lzma2SyncComp), 'lzma2 compressSync must return a Buffer');
assert(lzma2SyncComp.length > 0, 'lzma2 compressed buffer must not be empty');
const lzma2SyncDecomp = decompressLzma2Sync(lzma2SyncComp);
assert(Buffer.isBuffer(lzma2SyncDecomp), 'lzma2 decompressSync must return a Buffer');
assert.strictEqual(lzma2SyncDecomp.toString('utf8'), payload, 'lzma2 sync decompressed text must match original');
// Contract 6: lzma2.compress and lzma2.decompress round-trip Buffer asynchronously
const lzma2AsyncComp = await compressLzma2(original);
assert(Buffer.isBuffer(lzma2AsyncComp), 'lzma2 compress must resolve to a Buffer');
assert(lzma2AsyncComp.length > 0, 'lzma2 async compressed buffer must not be empty');
const lzma2AsyncDecomp = await decompressLzma2(lzma2AsyncComp);
assert(Buffer.isBuffer(lzma2AsyncDecomp), 'lzma2 decompress must resolve to a Buffer');
assert.strictEqual(lzma2AsyncDecomp.toString('utf8'), payload, 'lzma2 async decompressed text must match original');
console.log('All contract tests passed.');
}
run().catch((err) => {
console.error(err);
process.exit(1);
});
Ursprungs-Seeder
anonym