{"name":"bip66","version":"2.0.0","type":"module","description":"Strict DER signature encoding/decoding.","keywords":["bip66","bitcoin"],"homepage":"https://github.com/bitcoinjs/bip66","bugs":{"url":"https://github.com/bitcoinjs/bip66/issues"},"license":"MIT","author":{"name":"Daniel Cousens"},"main":"src/cjs/index.cjs","module":"src/esm/index.js","types":"src/cjs/index.d.ts","exports":{".":{"types":"./src/cjs/index.d.ts","import":"./src/esm/index.js","require":"./src/cjs/index.cjs"}},"repository":{"type":"git","url":"git+https://github.com/bitcoinjs/bip66.git"},"scripts":{"build":"npm run clean && tsc -p ./tsconfig.json && tsc -p ./tsconfig.cjs.json; npm run standard -- --fix","postbuild":"find src/cjs -type f -name \"*.js\" -exec bash -c 'mv \"$0\" \"${0%.js}.cjs\"' {} \\;","standard":"ts-standard --ignore test --ignore src","gitdiff":"npm run build && git diff --exit-code","clean":"rimraf src","coverage":"c8 --check-coverage --branches 100 --functions 100 tape test/*.js","lint":"npm run standard","test":"npm run lint && npm run unit","unit":"tape test/*.js"},"devDependencies":{"@types/node":"^20.14.8","c8":"^10.1.2","rimraf":"^5.0.7","tape":"^5.3.0","ts-standard":"^12.0.2","typescript":"~5.1.0"},"gitHead":"08169640fc2d9a5f4007f7a4493a2f4627c07cfc","_id":"bip66@2.0.0","_nodeVersion":"18.16.1","_npmVersion":"9.5.1","dist":{"integrity":"sha512-kBG+hSpgvZBrkIm9dt5T1Hd/7xGCPEX2npoxAWZfsK1FvjgaxySEh2WizjyIstWXriKo9K9uJ4u0OnsyLDUPXQ==","shasum":"96b5cca18ad10a009f7c8ea4eb24079e37ec9c79","tarball":"http://registry-npm.ywwl.com/bip66/download/bip66-2.0.0.tgz","fileCount":6,"unpackedSize":12390,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFFYPS9mcALteFTm3RcYz2nKBGlsAct3X5f/I46a7oeEAiEA5arsp7ynwt/NE++dWiYMzA11ZNXRX8LzN/n4ozFjybU="}],"size":3616,"noattachment":false,"key":"/bip66/-/bip66-2.0.0.tgz"},"_npmUser":{"name":"junderw","email":"jonathan.underwood4649@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bip66_2.0.0_1719391566637_0.8010701323017699"},"_hasShrinkwrap":false,"readme":"# bip66\n\n[![NPM Package](https://img.shields.io/npm/v/bip66.svg?style=flat-square)](https://www.npmjs.org/package/bip66)\n[![Build Status](https://img.shields.io/travis/bitcoinjs/bip66.svg?branch=master&style=flat-square)](https://travis-ci.org/bitcoinjs/bip66)\n\n[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)\n\nStrict DER signature encoding/decoding.\n\nSee [bip66](https://github.com/bitcoin/bips/blob/master/bip-0066.mediawiki).\n\n- This module **works only with [two's complement](https://en.wikipedia.org/wiki/Two's_complement) numbers**.\n- BIP66 doesn't check that `r` or `s` are fully valid.\n  - `check`/`decode` doesn't check that `r` or `s` great than 33 bytes or that this number represent valid point on elliptic curve.\n  - `encode` doesn't check that `r`/`s` represent valid point on elliptic curve.\n\n## Example\n\n``` javascript\nimport * as bip66 from\"bip66\"\nconst r = Buffer.from('1ea1fdff81b3a271659df4aad19bc4ef83def389131a36358fe64b245632e777', 'hex')\nconst s = Buffer.from('29e164658be9ce810921bf81d6b86694785a79ea1e52dbfa5105148d1f0bc1', 'hex')\n\n// Buffer or UInt8Array can be passed in to the encode/decode functions\nconst signature = bip66.encode(r, s)\n// Uint8Array(69) [\n//    48,  67,   2,  32,  30, 161, 253, 255, 129, 179, 162,\n//   113, 101, 157, 244, 170, 209, 155, 196, 239, 131, 222,\n//   243, 137,  19,  26,  54,  53, 143, 230,  75,  36,  86,\n//    50, 231, 119,   2,  31,  41, 225, 100, 101, 139, 233,\n//   206, 129,   9,  33, 191, 129, 214, 184, 102, 148, 120,\n//    90, 121, 234,  30,  82, 219, 250,  81,   5,  20, 141,\n//    31,  11, 193\n// ]\n\nbip66.decode(signature)\n// => {\n//   r: Uint8Array(32) [\n//      30, 161, 253, 255, 129, 179, 162,\n//     113, 101, 157, 244, 170, 209, 155,\n//     196, 239, 131, 222, 243, 137,  19,\n//      26,  54,  53, 143, 230,  75,  36,\n//      86,  50, 231, 119\n//   ],\n//   s: Uint8Array(31) [\n//      41, 225, 100, 101, 139, 233, 206, 129,\n//       9,  33, 191, 129, 214, 184, 102, 148,\n//     120,  90, 121, 234,  30,  82, 219, 250,\n//      81,   5,  20, 141,  31,  11, 193\n//   ]\n// }\n```\n\nA catch-all exception regex:\n``` javascript\n/Expected DER (integer|sequence)|(R|S) value (excessively padded|is negative)|(R|S|DER sequence) length is (zero|too short|too long|invalid)/\n```\n\n## LICENSE [MIT](LICENSE)\n","publish_time":1719391566790,"maintainers":[{"name":"fanatid","email":"fanatid@ya.ru"},{"name":"jprichardson","email":"jprichardson@gmail.com"},{"name":"junderw","email":"jonathan.underwood4649@gmail.com"}],"_cnpm_publish_time":1719391566790,"dist-tags":{"latest":"2.0.0"}}