{"name":"@pnpm/crypto.integrity","version":"1100.0.6","description":"Parse and validate integrity strings","keywords":["pnpm","pnpm11","crypto","integrity"],"license":"MIT","funding":"https://opencollective.com/pnpm","repository":{"type":"git","url":"https://github.com/pnpm/pnpm/tree/main/pnpm11/crypto/integrity"},"homepage":"https://github.com/pnpm/pnpm/tree/main/pnpm11/crypto/integrity#readme","bugs":{"url":"https://github.com/pnpm/pnpm/issues"},"type":"module","main":"lib/index.js","types":"lib/index.d.ts","exports":{".":"./lib/index.js"},"dependencies":{"@pnpm/error":"1100.1.4"},"devDependencies":{"@jest/globals":"30.4.1","@pnpm/crypto.integrity":"1100.0.6"},"engines":{"node":">=22.13"},"jest":{"preset":"@pnpm/jest-config"},"scripts":{"lint":"eslint \"src/**/*.ts\" \"test/**/*.ts\"","test":"pn compile && pn .test","compile":"tsgo --build && pn lint --fix",".test":"cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --disable-warning=ExperimentalWarning --disable-warning=DEP0169\" jest"},"_id":"@pnpm/crypto.integrity@1100.0.6","dist":{"integrity":"sha512-4DZlkVBefPZJNbYIomW0jvc2Bi9jALAAuuLVujRVltBETITVbOEMwWmtt5wIg/Urxfva9+tcKcrm+m8lSAEZVQ==","shasum":"5bf2c66766ec1a9bc91cb467fe6b6cd0eca13129","tarball":"http://registry-npm.ywwl.com/@pnpm/crypto.integrity/download/@pnpm/crypto.integrity-1100.0.6.tgz","fileCount":6,"unpackedSize":5917,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@pnpm%2fcrypto.integrity@1100.0.6","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDgmPPsrHiC2eweQQ4QzRVF3yIPmGvGtQ2N7O4cQ+GsSAIgYHCIXT762Hz15kPn9HCSo7Al7gsLZu9vfRK6sf69B/k="}],"size":2696,"noattachment":false,"key":"/@pnpm/crypto.integrity/-/@pnpm/crypto.integrity-1100.0.6.tgz"},"_npmUser":{"name":"pnpmuser","email":"publish-bot@pnpm.io"},"directories":{},"maintainers":[{"name":"pnpmuser","email":"publish-bot@pnpm.io"},{"name":"zkochan","email":"z@kochan.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/crypto.integrity_1100.0.6_1788737983656_0.6773826474530691"},"_hasShrinkwrap":false,"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":1788737983783,"_cnpm_publish_time":1788737983783,"dist-tags":{"latest":"1100.0.9"}}