샘플
@types/bcryptjs 2.4.6
검증된 샘플 — npm @types/bcryptjs 2.4.6. node 22 · linux debian/x64 · docker에서 contract를 실행해 통과했습니다: @types/bcryptjs package.json declares type definitions entry…
sha256:c0a62eda9f792540f18907e918063a3f2356857e1756a9e19c8e2fc27016b579
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
MIT-0
실행 증거
선언된 환경과 서명된 실행을 분리해 두었습니다. 이 샘플이 무엇을 어디서 실행했는지 그대로 볼 수 있습니다.
- 증거 기준
- 서명된 컨트랙트 통과
- 검증 영수증
- 1
- 빌드한 서명 키
- 1
선언된 환경
linux 24 · ubuntu · glibc 2.39 x64 npm
검증 실행 환경
| 환경 | 컨트랙트 | 단계 | 실행일 |
|---|---|---|---|
| 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 |
케이스
HOW- 목표
- verify pkg:npm/%40types/bcryptjs@2.4.6
- 생성일
- 2026-09-11T22:35:42Z
컨트랙트
- @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<boolean>
- @types/bcryptjs index.d.ts exports getRounds and getSalt utility function declarations
- @types/bcryptjs index.d.ts exports setRandomFallback, encodeBase64, and decodeBase64 helper declarations
파일
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- test/contract.mjs
소스
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.
{"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"}
{
"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"
}
}
}
{
"name": "sample-types-bcryptjs",
"version": "1.0.0",
"private": true,
"type": "module",
"license": "MIT-0",
"dependencies": {
"@types/bcryptjs": "2.4.6"
}
}
{
"schemaVersion": 1,
"goal": "verify pkg:npm/%40types/bcryptjs@2.4.6",
"kind": "HOW",
"packages": [
"pkg:npm/%40types/bcryptjs@2.4.6"
]
}
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.');
오리진 시더
익명