{"name":"@pnpm/crypto.integrity","version":"1100.0.0-0","keywords":["pnpm","pnpm11","crypto","integrity"],"license":"MIT","_id":"@pnpm/crypto.integrity@1100.0.0-0","maintainers":[{"name":"pnpmuser","email":"publish-bot@pnpm.io"},{"name":"zkochan","email":"z@kochan.io"}],"homepage":"https://github.com/pnpm/pnpm/tree/main/crypto/integrity#readme","bugs":{"url":"https://github.com/pnpm/pnpm/issues"},"dist":{"shasum":"36c12df344bc92572a1e24d1cdd926069a8efbc7","tarball":"http://registry-npm.ywwl.com/@pnpm/crypto.integrity/download/@pnpm/crypto.integrity-1100.0.0-0.tgz","fileCount":6,"integrity":"sha512-u/tPdyxKlcYbDSymxuUj069zj4+xRBsb0R715NGQAdlIZXGbm6SEBjVnLDXABMUNILUExSz1+ZoGYxUpI1EKhQ==","signatures":[{"sig":"MEUCIDYRZ5hRZzUQP0s5aRX4Ax0uOhp/ThEXxRSB6VUiQ6XhAiEAjvl5SZBhajG45xFbPzmOQyS1aQYQij7bKs6ptJBFRD8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6010,"size":2815,"noattachment":false,"key":"/@pnpm/crypto.integrity/-/@pnpm/crypto.integrity-1100.0.0-0.tgz"},"jest":{"preset":"@pnpm/jest-config"},"main":"lib/index.js","type":"module","_from":"file:pnpm-crypto.integrity-1100.0.0-0.tgz","types":"lib/index.d.ts","engines":{"node":">=22.12"},"exports":{".":"./lib/index.js"},"funding":"https://opencollective.com/pnpm","scripts":{"lint":"eslint \"src/**/*.ts\" \"test/**/*.ts\"","test":"pnpm run compile && pnpm run _test","_test":"cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest","compile":"tsgo --build && pnpm run lint --fix"},"_npmUser":{"name":"pnpmuser","email":"publish-bot@pnpm.io"},"_resolved":"/tmp/fae5499537beb0557eade1af10ac7d3e/pnpm-crypto.integrity-1100.0.0-0.tgz","_integrity":"sha512-u/tPdyxKlcYbDSymxuUj069zj4+xRBsb0R715NGQAdlIZXGbm6SEBjVnLDXABMUNILUExSz1+ZoGYxUpI1EKhQ==","repository":{"url":"git+https://github.com/pnpm/pnpm.git#main","type":"git"},"_npmVersion":"11.6.2","description":"Parse and validate integrity strings","directories":{},"_nodeVersion":"24.11.1","dependencies":{"@pnpm/error":"1000.0.5"},"_hasShrinkwrap":false,"devDependencies":{"@pnpm/crypto.integrity":"1100.0.0-0"},"_npmOperationalInternal":{"tmp":"tmp/crypto.integrity_1100.0.0-0_1771329892078_0.1059151936408933","host":"s3://npm-registry-packages-npm-production"},"readme":"# @pnpm/crypto.integrity\n\n> Parse and format integrity strings\n\nUtilities for working with single-hash integrity strings in the format `algorithm-base64hash` (e.g., `sha512-abc123...`). This is the format used in pnpm lockfiles.\n\n## Installation\n\n```sh\npnpm add @pnpm/crypto.integrity\n```\n\n## Usage\n\n```ts\nimport { parseIntegrity } from '@pnpm/crypto.integrity'\n\nconst { algorithm, hexDigest } = parseIntegrity('sha512-9/u6bgY2+JDlb7vzKD5STG+jIErimDgtYkdB0NxmODJuKCxBvl5CVNiCB3LFUYosWowMf37aGVlKfrU5RT4e1w==')\n\nconsole.log(algorithm)  // 'sha512'\nconsole.log(hexDigest)  // 'f7fbba6e0636f890e56fbbf3283e524c6fa3204ae298382d624741d0dc6638326e282c41be5e4254d8820772c5518a2c5a8c0c7f7eda19594a7eb539453e1ed7'\n```\n\n## API\n\n### `parseIntegrity(integrity: string): ParsedIntegrity`\n\nParses an integrity string and returns the algorithm and hex-encoded digest.\n\nThrows `PnpmError` with code `INVALID_INTEGRITY` if:\n- The format is invalid (must be `algorithm-base64hash`)\n- The base64 hash decodes to an empty digest\n\n### `formatIntegrity(algorithm: string, hexDigest: string): string`\n\nFormats a hex digest into an integrity string.\n\n```ts\nimport { formatIntegrity } from '@pnpm/crypto.integrity'\n\nconst integrity = formatIntegrity('sha512', 'f7fbba6e...')\n// 'sha512-9/u6bgY2+JDlb7vzKD5STG+...'\n```\n\n## License\n\nMIT\n","publish_time":1771329892221,"_cnpm_publish_time":1771329892221,"dist-tags":{"latest":"1100.0.9"}}