{"_id":"@agentine/signet","name":"@agentine/signet","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@agentine/signet","version":"0.1.0","description":"Deterministic object hashing for Node.js — drop-in replacement for object-hash","repository":{"type":"git","url":"git+https://github.com/agentine/signet.git"},"license":"MIT","type":"module","engines":{"node":">=18"},"exports":{".":{"types":"./dist/esm/index.d.ts","import":"./dist/esm/index.js","require":"./dist/cjs/index.js"},"./compat/object-hash":{"types":"./dist/esm/compat/object-hash.d.ts","import":"./dist/esm/compat/object-hash.js","require":"./dist/cjs/compat/object-hash.js"}},"main":"./dist/cjs/index.js","module":"./dist/esm/index.js","types":"./dist/esm/index.d.ts","scripts":{"build":"npm run build:esm && npm run build:cjs","build:esm":"tsc -p tsconfig.json","build:cjs":"tsc -p tsconfig.cjs.json && cp src/cjs-package.json dist/cjs/package.json","clean":"rm -rf dist","test":"vitest run"},"devDependencies":{"@types/node":"^22.0.0","@types/object-hash":"^3.0.6","object-hash":"^3.0.0","typescript":"^5.4.0","vitest":"^3.0.0"},"_id":"@agentine/signet@0.1.0","gitHead":"81c55fcda50cecd54706ef579e72511ecd0ca694","bugs":{"url":"https://github.com/agentine/signet/issues"},"homepage":"https://github.com/agentine/signet#readme","_nodeVersion":"22.22.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-dwJRTrmLNokCFaNYtacX3oqNJtjcBLnpbrD6gSK0WxXg+qDvK427tgWi/dIBsB/A6zsaG+SRR1fLojxJykBHlQ==","shasum":"8f6b88f9bd3146689d8d34dd66dd253d2f5daca0","tarball":"https://registry.npmjs.org/@agentine/signet/-/signet-0.1.0.tgz","fileCount":43,"unpackedSize":62415,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@agentine%2fsignet@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCnjwBwtZqVoQRXDRA6OSVn18b5aEoU/W2ufpr+BKM7mwIhAJfe7MOb8lgW0fjTUyWbm7NW4c7JYAgGj3ElRDQai227"}]},"_npmUser":{"name":"mtingers","email":"matthingersoll@gmail.com"},"directories":{},"maintainers":[{"name":"mtingers","email":"matthingersoll@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/signet_0.1.0_1773634438667_0.47778868611337444"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-16T04:13:58.593Z","0.1.0":"2026-03-16T04:13:58.830Z","modified":"2026-03-16T04:13:59.184Z"},"maintainers":[{"name":"mtingers","email":"matthingersoll@gmail.com"}],"description":"Deterministic object hashing for Node.js — drop-in replacement for object-hash","homepage":"https://github.com/agentine/signet#readme","repository":{"type":"git","url":"git+https://github.com/agentine/signet.git"},"bugs":{"url":"https://github.com/agentine/signet/issues"},"license":"MIT","readme":"# @agentine/signet\n\nDeterministic object hashing for Node.js — drop-in replacement for [object-hash](https://github.com/puleos/object-hash).\n\n- TypeScript-first with full type safety\n- Zero runtime dependencies\n- ESM + CJS dual build\n- Node.js 18+\n- Byte-identical output to object-hash v3.0.0\n\n## Install\n\n```bash\nnpm install @agentine/signet\n```\n\n## Usage\n\n```typescript\nimport hash from '@agentine/signet';\n\n// Default: sha1 + hex\nhash({ foo: 'bar' });\n// => '67b69634f9880a282c14a0f0cb3ba90cddb95014'\n\n// Algorithm and encoding\nhash(obj, { algorithm: 'sha256', encoding: 'base64' });\n\n// Exclude keys\nhash(obj, { excludeKeys: (key) => key.startsWith('_') });\n\n// Hash structure only (keys, no values)\nhash(obj, { excludeValues: true });\n\n// Ignore prototype chain\nhash(obj, { respectType: false });\n\n// Sort arrays before hashing\nhash(obj, { unorderedArrays: true });\n\n// Sugar methods\nhash.sha1(obj);\nhash.MD5(obj);\nhash.keys(obj);       // excludeValues + sha1\nhash.keysMD5(obj);    // excludeValues + md5\n\n// Streaming\nhash.writeToStream(obj, options, stream);\nhash.writeToStream(obj, stream); // options optional\n```\n\n## Options\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `algorithm` | `'sha1' \\| 'sha256' \\| 'sha512' \\| 'md5' \\| 'passthrough'` | `'sha1'` | Hash algorithm |\n| `encoding` | `'hex' \\| 'base64' \\| 'buffer' \\| 'binary'` | `'hex'` | Output encoding |\n| `excludeKeys` | `(key: string) => boolean` | — | Filter out object keys |\n| `excludeValues` | `boolean` | `false` | Hash keys only |\n| `ignoreUnknown` | `boolean` | `false` | Skip unknown types instead of throwing |\n| `respectType` | `boolean` | `true` | Include prototype/constructor in hash |\n| `respectFunctionNames` | `boolean` | `true` | Include function names |\n| `respectFunctionProperties` | `boolean` | `true` | Include function properties |\n| `unorderedArrays` | `boolean` | `false` | Sort arrays before hashing |\n| `unorderedSets` | `boolean` | `true` | Sort Sets/Maps before hashing |\n| `unorderedObjects` | `boolean` | `true` | Sort object keys |\n| `replacer` | `(value: unknown) => unknown` | — | Transform values before hashing |\n\n## Migrating from object-hash\n\n### Option 1: Direct replacement\n\n```diff\n-import hash from 'object-hash';\n+import hash from '@agentine/signet';\n```\n\n### Option 2: Compatibility layer\n\n```diff\n-const hash = require('object-hash');\n+const hash = require('@agentine/signet/compat/object-hash');\n```\n\nBoth produce identical hash output for all supported types.\n\n## Supported Types\n\nPrimitives: string, number, boolean, null, undefined, bigint, symbol.\nObjects: plain objects, class instances, null-prototype objects.\nCollections: Array, Set, Map, TypedArrays, ArrayBuffer, Buffer.\nSpecial: Date, RegExp, Error, URL, functions.\nCircular references are detected and handled.\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-70bc752cde047a4002e7ec12178e0c2b"}