Beispiel
chromium-pickle-js 0.2.0: createEmpty, createFromBuffer
Verifiziertes Beispiel für npm chromium-pickle-js 0.2.0: createEmpty, createFromBuffer. Der Vertrag lief auf node 22 · linux alpine/x64 · docker und bestand.
sha256:258c307b68344ed1f201fa4a1d3acd6c6b0dd7ddfdfbafca4e3bbfb2ca0e8951
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
- 2
- Signaturschlüssel, die es gebaut haben
- 1
Deklarierte Umgebung
node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm 10
Umgebungen der Verifizierungsläufe
| Umgebung | Contract | Stufen | Lauf |
|---|---|---|---|
| node 22 · linux alpine/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · node-typescript@1node:22-alpine@sha256:c610fcdfb1d5… |
2026-08-26 |
| 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-09-08 |
Fall
HOW- Ziel
- verify pkg:npm/chromium-pickle-js@0.2.0
- Pakete
- Symbole
-
- createEmpty
- createFromBuffer
- Umgebung
- node 22.23.2
- Erstellt
- 2026-08-26T09:11:46Z
Contract
- createEmpty returns a new Pickle instance that can write bool, int, uint32, float, double, and string primitives
- Pickle.toBuffer returns a Buffer containing the 4-byte payload size header followed by 4-byte aligned payload data
- createFromBuffer initializes a Pickle instance from an existing Buffer for reading with PickleIterator
- PickleIterator sequentially reads bool, int, uint32, float, double, and string values in matching write order
- Pickle.writeInt64 and Pickle.writeUInt64 throw TypeError in Node.js because 64-bit buffer write methods are undefined on Buffer.prototype
- PickleIterator throws an Error when attempting to read past the payload buffer end
Dateien
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- src/index.mjs
- test/contract.mjs
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/chromium-pickle-js@0.2.0
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/chromium-pickle-js@0.2.0
Constraints:
- executionContext: node
Required runtime conditions:
- ecosystem: npm
- language: javascript
- moduleSystem: cjs
- packageManager: npm@10.9.8
- 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:2a8593e5836b43efa8f92fa1b859ef2940f790b35ad5147c877cd3218bee6c31","constraints":{"executionContext":"node"},"contract":["createEmpty returns a new Pickle instance that can write bool, int, uint32, float, double, and string primitives","Pickle.toBuffer returns a Buffer containing the 4-byte payload size header followed by 4-byte aligned payload data","createFromBuffer initializes a Pickle instance from an existing Buffer for reading with PickleIterator","PickleIterator sequentially reads bool, int, uint32, float, double, and string values in matching write order","Pickle.writeInt64 and Pickle.writeUInt64 throw TypeError in Node.js because 64-bit buffer write methods are undefined on Buffer.prototype","PickleIterator throws an Error when attempting to read past the payload buffer end"],"goal":"verify pkg:npm/chromium-pickle-js@0.2.0","kind":"HOW","packages":["pkg:npm/chromium-pickle-js@0.2.0"],"schemaVersion":1,"symbols":["createEmpty","createFromBuffer"]},"contractCommand":["node","test/contract.mjs"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"npm","executionContext":"node","language":"javascript","libc":"glibc","libcVersion":"2.39","moduleSystem":"cjs","os":"linux","osVersionBucket":"24","packageManager":"npm","packageManagerVersion":"10.9.8","runtime":"node","runtimeVersion":"22.23.2","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/chromium-pickle-js@0.2.0"],"schemaVersion":1,"subject":"pkg:npm/chromium-pickle-js@0.2.0","symbols":["createEmpty","createFromBuffer"],"verifierAdapter":"node-typescript@1"}
{
"name": "sample-chromium-pickle-js",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-chromium-pickle-js",
"version": "1.0.0",
"dependencies": {
"chromium-pickle-js": "0.2.0"
}
},
"node_modules/chromium-pickle-js": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/chromium-pickle-js/-/chromium-pickle-js-0.2.0.tgz",
"integrity": "sha512-1R5Fho+jBq0DDydt+/vHWj5KJNJCKdARKOCwZUen84I5BreWoLqRLANH1U87eJy1tiASPtMnGqJJq0ZsLoRPOw==",
"license": "MIT"
}
}
}
{
"name": "sample-chromium-pickle-js",
"version": "1.0.0",
"type": "module",
"private": true,
"dependencies": {
"chromium-pickle-js": "0.2.0"
}
}
{
"schemaVersion": 1,
"goal": "verify pkg:npm/chromium-pickle-js@0.2.0",
"kind": "HOW",
"packages": [
"pkg:npm/chromium-pickle-js@0.2.0"
],
"constraints": {
"executionContext": "node"
},
"runtimeConditions": {
"ecosystem": "npm",
"language": "javascript",
"moduleSystem": "cjs",
"packageManager": "npm@10.9.8",
"runtime": "node@22.23.2"
}
}
import pickle from 'chromium-pickle-js';
const { createEmpty, createFromBuffer } = pickle;
/**
* Creates an empty Pickle instance for writing binary data.
* @returns {object}
*/
export function createEmptyPickle() {
return createEmpty();
}
/**
* Creates a Pickle instance from an existing Buffer for reading.
* @param {Buffer} buffer
* @returns {object}
*/
export function createPickleFromBuffer(buffer) {
return createFromBuffer(buffer);
}
export { createEmpty, createFromBuffer };
import assert from 'node:assert/strict';
import {
createEmpty,
createFromBuffer,
createEmptyPickle,
createPickleFromBuffer,
} from '../src/index.mjs';
// 1. createEmpty returns a new Pickle instance that can write bool, int, uint32, float, double, and string primitives
{
const p = createEmptyPickle();
assert.equal(p.writeBool(true), true);
assert.equal(p.writeBool(false), true);
assert.equal(p.writeInt(-12345), true);
assert.equal(p.writeUInt32(54321), true);
assert.equal(p.writeFloat(1.5), true);
assert.equal(p.writeDouble(3.141592653589793), true);
assert.equal(p.writeString('chromium-pickle-sample'), true);
}
// 2. Pickle.toBuffer returns a Buffer containing the 4-byte payload size header followed by 4-byte aligned payload data
{
const p = createEmpty();
assert.equal(p.writeInt(42), true);
const buf = p.toBuffer();
assert.ok(Buffer.isBuffer(buf));
const payloadSize = buf.readUInt32LE(0);
assert.equal(payloadSize, 4);
assert.equal(buf.length, 8);
assert.equal(buf.readInt32LE(4), 42);
}
// 3. createFromBuffer initializes a Pickle instance from an existing Buffer for reading with PickleIterator
{
const pWrite = createEmpty();
assert.equal(pWrite.writeString('read-test'), true);
const buf = pWrite.toBuffer();
const pRead = createPickleFromBuffer(buf);
const it = pRead.createIterator();
assert.equal(it.readString(), 'read-test');
}
// 4. PickleIterator sequentially reads bool, int, uint32, float, double, and string values in matching write order
{
const p = createEmpty();
assert.equal(p.writeBool(true), true);
assert.equal(p.writeBool(false), true);
assert.equal(p.writeInt(-9876), true);
assert.equal(p.writeUInt32(65432), true);
assert.equal(p.writeFloat(2.5), true);
assert.equal(p.writeDouble(2.718281828459045), true);
assert.equal(p.writeString('sequential-test'), true);
const buf = p.toBuffer();
const pRead = createFromBuffer(buf);
const it = pRead.createIterator();
assert.equal(it.readBool(), true);
assert.equal(it.readBool(), false);
assert.equal(it.readInt(), -9876);
assert.equal(it.readUInt32(), 65432);
assert.equal(it.readFloat(), 2.5);
assert.equal(it.readDouble(), 2.718281828459045);
assert.equal(it.readString(), 'sequential-test');
}
// 5. Pickle.writeInt64 and Pickle.writeUInt64 throw TypeError in Node.js because 64-bit buffer write methods are undefined on Buffer.prototype
{
const p = createEmpty();
assert.throws(
() => {
p.writeInt64(100);
},
{
name: 'TypeError',
}
);
assert.throws(
() => {
p.writeUInt64(100);
},
{
name: 'TypeError',
}
);
}
// 6. PickleIterator throws an Error when attempting to read past the payload buffer end
{
const p = createEmpty();
assert.equal(p.writeInt(100), true);
const buf = p.toBuffer();
const pRead = createFromBuffer(buf);
const it = pRead.createIterator();
assert.equal(it.readInt(), 100);
assert.throws(
() => {
it.readInt();
},
{
name: 'Error',
message: /Failed to read data with length of/,
}
);
}
console.log('Contract assertions passed.');
Ursprungs-Seeder
anonym