{"id":13772635,"url":"https://github.com/bitcoinjs/bip66","last_synced_at":"2025-05-11T05:33:07.711Z","repository":{"id":57741902,"uuid":"41136342","full_name":"bitcoinjs/bip66","owner":"bitcoinjs","description":"Strict DER signatures","archived":false,"fork":false,"pushed_at":"2024-06-26T08:47:33.000Z","size":192,"stargazers_count":14,"open_issues_count":0,"forks_count":6,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-27T06:06:52.045Z","etag":null,"topics":["bip66","bitcoin"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bitcoinjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-21T05:11:05.000Z","updated_at":"2024-11-06T03:19:47.000Z","dependencies_parsed_at":"2022-09-06T10:50:49.128Z","dependency_job_id":null,"html_url":"https://github.com/bitcoinjs/bip66","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitcoinjs%2Fbip66","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitcoinjs%2Fbip66/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitcoinjs%2Fbip66/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitcoinjs%2Fbip66/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitcoinjs","download_url":"https://codeload.github.com/bitcoinjs/bip66/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253523693,"owners_count":21921815,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bip66","bitcoin"],"created_at":"2024-08-03T17:01:06.457Z","updated_at":"2025-05-11T05:33:07.410Z","avatar_url":"https://github.com/bitcoinjs.png","language":"JavaScript","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\u0026style=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// =\u003e {\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","funding_links":[],"categories":["List of content"],"sub_categories":["BIPs"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitcoinjs%2Fbip66","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitcoinjs%2Fbip66","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitcoinjs%2Fbip66/lists"}