CodeSampleX

Sample

@types/bcryptjs 2.4.6

Verified sample for npm @types/bcryptjs 2.4.6. The contract ran on node 22 · linux debian/x64 · docker and passed: @types/bcryptjs package.json declares type…

sha256:c0a62eda9f792540f18907e918063a3f2356857e1756a9e19c8e2fc27016b579

This network offers one thing: a sample that builds. It ran the sample in a sandbox and kept the signed receipt. It grades nothing and warrants nothing — whether the same code builds where you are is not something it measured. How many distinct signing keys filed a passing contract receipt. One is the author alone; more than one means somebody else built it too. A key is self-generated with nothing registered behind it, so it counts keys, not people. MIT-0

Execution evidence

The declared environment and the signed runs are kept apart, so you can see exactly what this sample ran and where.

Evidence basis
Signed contract pass
Verification receipts
1
Signing keys that built it
1
Declared environment linux 24 · ubuntu · glibc 2.39 x64 npm

Verification-run environments

Environment Contract Stages Run
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-11

Case

HOW
Goal
verify pkg:npm/%40types/bcryptjs@2.4.6
Packages
Created
2026-09-11T22:35:42Z

Contract

  1. @types/bcryptjs package.json declares type definitions entry point index.d.ts and version 2.4.6
  2. @types/bcryptjs index.d.ts exports genSaltSync and genSalt function declarations with Promise and callback overloads
  3. @types/bcryptjs index.d.ts exports hashSync and hash function declarations with Promise, callback, and progressCallback overloads
  4. @types/bcryptjs index.d.ts exports compareSync and compare function declarations returning boolean or Promise<boolean>
  5. @types/bcryptjs index.d.ts exports getRounds and getSalt utility function declarations
  6. @types/bcryptjs index.d.ts exports setRandomFallback, encodeBase64, and decodeBase64 helper declarations

Files

  • PROMPT.md
  • csx.json
  • package-lock.json
  • package.json
  • spec.json
  • test/contract.mjs

Download the source artifact (tar.gz)

Source

PROMPT.md
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/%40types/bcryptjs@2.4.6
Kind: HOW

Use EXACTLY these public packages and versions:
  - pkg:npm/%40types/bcryptjs@2.4.6

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.
csx.json
{"case":{"caseId":"case:sha256:d1cdaf8c653016719d83a3449d21287f7c2bdf77d4b70613e45103f51695a54e","contract":["@types/bcryptjs package.json declares type definitions entry point index.d.ts and version 2.4.6","@types/bcryptjs index.d.ts exports genSaltSync and genSalt function declarations with Promise and callback overloads","@types/bcryptjs index.d.ts exports hashSync and hash function declarations with Promise, callback, and progressCallback overloads","@types/bcryptjs index.d.ts exports compareSync and compare function declarations returning boolean or Promise\u003cboolean\u003e","@types/bcryptjs index.d.ts exports getRounds and getSalt utility function declarations","@types/bcryptjs index.d.ts exports setRandomFallback, encodeBase64, and decodeBase64 helper declarations"],"goal":"verify pkg:npm/%40types/bcryptjs@2.4.6","kind":"HOW","packages":["pkg:npm/%40types/bcryptjs@2.4.6"],"schemaVersion":1},"contractCommand":["node","test/contract.mjs"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"npm","libc":"glibc","libcVersion":"2.39","os":"linux","osVersionBucket":"24","packageManager":"npm","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/%40types/bcryptjs@2.4.6"],"schemaVersion":1,"subject":"pkg:npm/%40types/bcryptjs@2.4.6","verifierAdapter":"node-typescript@1"}
package-lock.json
{
  "name": "sample-types-bcryptjs",
  "version": "1.0.0",
  "lockfileVersion": 3,
  "requires": true,
  "packages": {
    "": {
      "name": "sample-types-bcryptjs",
      "version": "1.0.0",
      "license": "MIT-0",
      "dependencies": {
        "@types/bcryptjs": "2.4.6"
      }
    },
    "node_modules/@types/bcryptjs": {
      "version": "2.4.6",
      "resolved": "https://registry.npmjs.org/@types/bcryptjs/-/bcryptjs-2.4.6.tgz",
      "integrity": "sha512-9xlo6R2qDs5uixm0bcIqCeMCE6HiQsIyel9KQySStiyqNl2tnj2mP3DX1Nf56MD6KMenNNlBBsy3LJ7gUEQPXQ==",
      "license": "MIT"
    }
  }
}
package.json
{
  "name": "sample-types-bcryptjs",
  "version": "1.0.0",
  "private": true,
  "type": "module",
  "license": "MIT-0",
  "dependencies": {
    "@types/bcryptjs": "2.4.6"
  }
}
spec.json
{
  "schemaVersion": 1,
  "goal": "verify pkg:npm/%40types/bcryptjs@2.4.6",
  "kind": "HOW",
  "packages": [
    "pkg:npm/%40types/bcryptjs@2.4.6"
  ]
}
test/contract.mjs
import assert from 'node:assert/strict';
import fs from 'node:fs';
import path from 'node:path';
import { createRequire } from 'node:module';

const require = createRequire(import.meta.url);

// 1. @types/bcryptjs package.json declares type definitions entry point index.d.ts and version 2.4.6
const pkgJsonPath = require.resolve('@types/bcryptjs/package.json');
assert.ok(fs.existsSync(pkgJsonPath), 'package.json must exist');
const pkgJson = JSON.parse(fs.readFileSync(pkgJsonPath, 'utf8'));
assert.equal(pkgJson.name, '@types/bcryptjs', 'package name must match');
assert.equal(pkgJson.version, '2.4.6', 'package version must be 2.4.6');
assert.equal(pkgJson.types, 'index.d.ts', 'types field must point to index.d.ts');

const pkgDir = path.dirname(pkgJsonPath);
const dtsPath = path.join(pkgDir, 'index.d.ts');
assert.ok(fs.existsSync(dtsPath), 'index.d.ts must exist');
const dts = fs.readFileSync(dtsPath, 'utf8');

// 2. @types/bcryptjs index.d.ts exports genSaltSync and genSalt function declarations with Promise and callback overloads
assert.ok(
  dts.includes('export declare function genSaltSync(rounds?: number): string;'),
  'must declare genSaltSync'
);
assert.ok(
  dts.includes('export declare function genSalt(rounds?: number): Promise<string>;'),
  'must declare genSalt returning Promise'
);
assert.ok(
  dts.includes('export declare function genSalt(callback: (err: Error | null, salt: string) => void): void;'),
  'must declare genSalt with callback'
);
assert.ok(
  dts.includes('export declare function genSalt(rounds: number, callback: (err: Error | null, salt: string) => void): void;'),
  'must declare genSalt with rounds and callback'
);

// 3. @types/bcryptjs index.d.ts exports hashSync and hash function declarations with Promise, callback, and progressCallback overloads
assert.ok(
  dts.includes('export declare function hashSync(s: string, salt?: number | string): string;'),
  'must declare hashSync'
);
assert.ok(
  dts.includes('export declare function hash(s: string, salt: number | string): Promise<string>;'),
  'must declare hash returning Promise'
);
assert.ok(
  dts.includes('export declare function hash(') &&
  dts.includes('callback?: (err: Error | null, hash: string) => void,') &&
  dts.includes('progressCallback?: (percent: number) => void,'),
  'must declare hash with progressCallback overload'
);

// 4. @types/bcryptjs index.d.ts exports compareSync and compare function declarations returning boolean or Promise<boolean>
assert.ok(
  dts.includes('export declare function compareSync(s: string, hash: string): boolean;'),
  'must declare compareSync'
);
assert.ok(
  dts.includes('export declare function compare(s: string, hash: string): Promise<boolean>;'),
  'must declare compare returning Promise<boolean>'
);
assert.ok(
  dts.includes('export declare function compare(') &&
  dts.includes('callback?: (err: Error | null, success: boolean) => void,'),
  'must declare compare with callback overload'
);

// 5. @types/bcryptjs index.d.ts exports getRounds and getSalt utility function declarations
assert.ok(
  dts.includes('export declare function getRounds(hash: string): number;'),
  'must declare getRounds'
);
assert.ok(
  dts.includes('export declare function getSalt(hash: string): string;'),
  'must declare getSalt'
);

// 6. @types/bcryptjs index.d.ts exports setRandomFallback, encodeBase64, and decodeBase64 helper declarations
assert.ok(
  dts.includes('export declare function setRandomFallback(random: (random: number) => number[]): void;'),
  'must declare setRandomFallback'
);
assert.ok(
  dts.includes('export declare function encodeBase64(b: Readonly<ArrayLike<number>>, len: number): string;'),
  'must declare encodeBase64'
);
assert.ok(
  dts.includes('export declare function decodeBase64(s: string, len: number): number[];'),
  'must declare decodeBase64'
);

console.log('Contract assertions passed.');

Origin Seeder

anonymous