Beispiel
bun 1.3.14: CryptoHasher, CryptoHasher.update, CryptoHasher.digest
Verifiziertes Beispiel für npm bun 1.3.14: CryptoHasher, CryptoHasher.update, CryptoHasher.digest. Der Vertrag lief auf bun 1 · linux alpine/x64 · docker und…
sha256:884a8685fa8d90916655ba691e2b11e038ba3c1e7a7ddc56adcd551085c8a05a
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
- 2
Deklarierte Umgebung
bun 1 linux x64 bun 1 javascript bun
Umgebungen der Verifizierungsläufe
| Umgebung | Contract | Stufen | Lauf |
|---|---|---|---|
| bun 1 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · npm@1 |
2026-08-19 |
| bun 1 · linux alpine/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · npm@1oven/bun:1-alpine@sha256:07235578f79e… |
2026-09-07 |
Fall
HOW- Ziel
- verify Bun.CryptoHasher in pkg:npm/bun@1.3.14
- Pakete
- Symbole
-
- Bun.CryptoHasher
- Bun.CryptoHasher.update
- Bun.CryptoHasher.digest
- Umgebung
- bun 1
- Erstellt
- 2026-08-18T13:32:46Z
Contract
- Bun.CryptoHasher computes cryptographic hashes natively with support for sha256, sha512, and md5 algorithms.
- Bun.CryptoHasher.update supports incremental streaming input chunks.
- Bun.CryptoHasher.digest returns raw Uint8Array, hex, and base64 encoded strings according to the requested encoding parameter.
Dateien
- PROMPT.md
- csx.json
- package.json
- spec.json
- 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 Bun.CryptoHasher in pkg:npm/bun@1.3.14
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/bun@1.3.14
Demonstrate these symbols/APIs:
- Bun.CryptoHasher
Required runtime conditions:
- ecosystem: golang
- language: go
- packageManager: go@1.26.5
- runtime: go@1.26.5
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:1d2bc513cdb518046919a5375468fadccddb71a905c0d5340237cbb1c2a5e71f","contract":["Bun.CryptoHasher computes cryptographic hashes natively with support for sha256, sha512, and md5 algorithms.","Bun.CryptoHasher.update supports incremental streaming input chunks.","Bun.CryptoHasher.digest returns raw Uint8Array, hex, and base64 encoded strings according to the requested encoding parameter."],"goal":"verify Bun.CryptoHasher in pkg:npm/bun@1.3.14","kind":"HOW","packages":["pkg:npm/bun@1.3.14"],"schemaVersion":1,"symbols":["Bun.CryptoHasher","Bun.CryptoHasher.update","Bun.CryptoHasher.digest"]},"contractCommand":["bun","test/contract.mjs"],"environment":{"arch":"x64","ecosystem":"npm","executionContext":"bun","language":"javascript","moduleSystem":"esm","os":"linux","packageManager":"bun","runtime":"bun","runtimeVersion":"1","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/bun@1.3.14"],"schemaVersion":1,"symbols":["Bun.CryptoHasher","Bun.CryptoHasher.update","Bun.CryptoHasher.digest"],"verifierAdapter":"npm@1"}
{
"name": "csx-bun-cryptohasher-contract",
"version": "1.0.0",
"private": true,
"type": "module"
}
{
"schemaVersion": 1,
"goal": "verify Bun.CryptoHasher in pkg:npm/bun@1.3.14",
"kind": "HOW",
"packages": [
"pkg:npm/bun@1.3.14"
],
"symbols": [
"Bun.CryptoHasher"
],
"runtimeConditions": {
"ecosystem": "golang",
"language": "go",
"packageManager": "go@1.26.5",
"runtime": "go@1.26.5"
}
}
import assert from 'node:assert/strict';
assert.equal(typeof Bun, 'object', 'Bun global is present');
assert.equal(typeof Bun.CryptoHasher, 'function', 'Bun.CryptoHasher constructor is present');
// 1. Basic SHA-256 hashing
const hasher = new Bun.CryptoHasher('sha256');
hasher.update('hello world');
const hexDigest = hasher.digest('hex');
assert.equal(hexDigest, 'b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9');
// 2. Incremental streaming updates
const streamHasher = new Bun.CryptoHasher('sha256');
streamHasher.update('hello ');
streamHasher.update('world');
assert.equal(streamHasher.digest('hex'), 'b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9');
// 3. Binary Uint8Array digest
const rawHasher = new Bun.CryptoHasher('sha256');
rawHasher.update('hello world');
const rawDigest = rawHasher.digest();
assert(rawDigest instanceof Uint8Array);
assert.equal(rawDigest.length, 32);
// 4. Base64 encoding format
const b64Hasher = new Bun.CryptoHasher('sha256');
b64Hasher.update('hello world');
assert.equal(b64Hasher.digest('base64'), Buffer.from(rawDigest).toString('base64'));
// 5. Multiple hash algorithms (md5, sha512)
const md5Hasher = new Bun.CryptoHasher('md5');
md5Hasher.update('hello world');
assert.equal(md5Hasher.digest('hex'), '5eb63bbbe01eeed093cb22bb8f5acdc3');
const sha512Hasher = new Bun.CryptoHasher('sha512');
sha512Hasher.update('hello world');
assert.equal(sha512Hasher.digest('hex').length, 128);
console.log('CONTRACT PASS: Bun.CryptoHasher supports incremental hashing and multiple output encodings');
Ursprungs-Seeder
anonym