{"name":"rlp","version":"4.0.0-beta.2","keywords":["rlp","ethereum"],"author":{"name":"martin becze","email":"mjbecze@gmail.com"},"license":"MPL-2.0","_id":"rlp@4.0.0-beta.2","maintainers":[{"name":"axic","email":"alex@rtfs.hu"},{"name":"holgerd77","email":"Holger.Drewes@gmail.com"},{"name":"ralxz","email":"ryan@ryanio.com"}],"contributors":[{"name":"Alex Beregszaszi","email":"alex@rtfs.hu"},{"name":"Holger Drewes","email":"Holger.Drewes@gmail.com"},{"name":"Paul Miller","email":"pkg@paulmillr.com"}],"homepage":"https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/rlp#readme","bugs":{"url":"https://github.com/ethereumjs/ethereumjs-monorepo/issues?q=is%3Aissue+label%3A%22package%3A+rlp%22"},"bin":{"rlp":"bin/rlp"},"dist":{"shasum":"a13ee0124426ae99c9112cf417c9cb265543f903","tarball":"http://registry-npm.ywwl.com/rlp/download/rlp-4.0.0-beta.2.tgz","fileCount":9,"integrity":"sha512-XWsr6lJiBdZIBh006tmYujbEgc6ZC7UYcs/zvFfgQykbpJ6pF8kseNTbxuffdR9ylZOJ9d0gvtqh00YLOZXFTQ==","signatures":[{"sig":"MEQCIHbv4sd30KL9LzEjle9Z06/WXjbbAVF1VTqah2u3htDLAiAsvGudcffOMNhNki8lTibI98MY62gOrk6FwbI1+IHUgw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":51220,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi1DEvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqj8Q/+J8t+I6MKn2qCtoOyIKQGMn9G75BYnI6zTCKWu9k3Y0VO8szG\r\nsI3a3g5mLOHry6C+Xcz2XS/Enl+hS+/ZQ2yynLVNiBJtPqDHOVRpDUhOtejP\r\n+S+8J2iVjEBwbH808SzlHTYn7HTVKgSTeXeEjSXYHGhcpXqreHWdWeW/h0tA\r\nSy+EDQ1gyScMJKMAunVIH88EkbgsLYypV2Go+OKo99G7V50DbWIB5blOSlJR\r\nKt99xgE2aIUHCXLVeT5zljQuRecHqJ9q1sZ+WhuxiO+opobIWio06OnmwUaJ\r\njuDfJvEaVLnivTIiCJojehEEypbG1eAVU6WtTsH+6fEQf5lICpUqVpUBC/lX\r\np1K0QJTtqqOLd1Mp3CGT5TJDg20jtcpuI1NXqvuoEi6ppwitdg0LbMVqQ6qS\r\n5WcYblNWplm93qD9c0lH6EQ0la499BqgJQfxAF5cFNkYS/PC+V4WvSi3qfnu\r\nFib1MZw9Se4GE4XUbG1/x7MDm8cgu01iWlKuxrqEExE64nlKzyt7aQplfQD2\r\n8jno3vAiMA34dSfViY67lqWhpdEho96GkNNdrO8WYDBbqTTYMuSxgxvWsZef\r\ns6frtDQGO70QH1sefAQ0hcI3t5LwhyvPVgkeK15qN0ouNwl0qpKXd8i+aaxD\r\n9WTcWb4JwpF8LwjpePadRYuYFW/kRy14dbU=\r\n=nWjA\r\n-----END PGP SIGNATURE-----\r\n","size":13878,"noattachment":false,"key":"/rlp/-/rlp-4.0.0-beta.2.tgz"},"main":"dist/index.js","types":"dist/index.d.ts","readme":"# rlp\n\n[![NPM Package][rlp-npm-badge]][rlp-npm-link]\n[![GitHub Issues][rlp-issues-badge]][rlp-issues-link]\n[![Actions Status][rlp-actions-badge]][rlp-actions-link]\n[![Code Coverage][rlp-coverage-badge]][rlp-coverage-link]\n[![Discord][discord-badge]][discord-link]\n\n[Recursive Length Prefix](https://eth.wiki/en/fundamentals/rlp) encoding for Node.js and the browser.\n\n## INSTALL\n\n`npm install rlp`\n\ninstall with `-g` if you want to use the CLI.\n\n## USAGE\n\n```typescript\nimport assert from 'assert'\nimport { RLP } from 'rlp'\n\nconst nestedList = [[], [[]], [[], [[]]]]\nconst encoded = RLP.encode(nestedList)\nconst decoded = RLP.decode(encoded)\nassert.deepEqual(nestedList, decoded)\n```\n\n## API\n\n`RLP.encode(plain)` - RLP encodes an `Array`, `Uint8Array` or `String` and returns a `Uint8Array`.\n\n`RLP.decode(encoded, [stream=false])` - Decodes an RLP encoded `Uint8Array`, `Array` or `String` and returns a `Uint8Array` or `NestedUint8Array`. If `stream` is enabled, it will just decode the first rlp sequence in the Uint8Array. By default, it would throw an error if there are more bytes in Uint8Array than used by the rlp sequence.\n\n### Buffer compatibility\n\nIf you would like to continue using Buffers like in rlp v2, you can use:\n\n```typescript\nimport assert from 'assert'\nimport { arrToBufArr, bufArrToArr } from '@ethereumjs/util'\nimport { RLP } from 'rlp'\n\nconst bufferList = [Buffer.from('123', 'hex'), Buffer.from('456', 'hex')]\nconst encoded = RLP.encode(bufArrToArr(bufferList))\nconst encodedAsBuffer = Buffer.from(encoded)\nconst decoded = RLP.decode(Uint8Array.from(encodedAsBuffer)) // or RLP.decode(encoded)\nconst decodedAsBuffers = arrToBufArr(decoded)\nassert.deepEqual(bufferList, decodedAsBuffers)\n```\n\n### BigInt Support\n\nStarting with v4 the usage of [BN.js](https://github.com/indutny/bn.js/) for big numbers has been removed from the library and replaced with the usage of the native JS [BigInt](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) data type (introduced in `ES2020`).\n\nPlease note that number-related API signatures have changed along with this version update and the minimal build target has been updated to `ES2020`.\n\n## CLI\n\n`rlp encode <JSON string>`\\\n`rlp decode <0x-prefixed hex string>`\n\n### Examples\n\n- `rlp encode '5'` -> `0x05`\n- `rlp encode '[5]'` -> `0xc105`\n- `rlp encode '[\"cat\", \"dog\"]'` -> `0xc88363617483646f67`\n- `rlp decode 0xc88363617483646f67` -> `[\"cat\",\"dog\"]`\n\n## TESTS\n\nTests use mocha.\n\nTo run tests and linting: `npm test`\n\nTo auto-fix linting problems run: `npm run lint:fix`\n\n## CODE COVERAGE\n\nInstall dev dependencies: `npm install`\n\nRun coverage: `npm run coverage`\n\nThe results will be at: `coverage/lcov-report/index.html`\n\n# EthereumJS\n\nSee our organizational [documentation](https://ethereumjs.readthedocs.io) for an introduction to `EthereumJS` as well as information on current standards and best practices.\n\nIf you want to join for work or do improvements on the libraries have a look at our [contribution guidelines](https://ethereumjs.readthedocs.io/en/latest/contributing.html).\n\n[discord-badge]: https://img.shields.io/static/v1?logo=discord&label=discord&message=Join&color=blue\n[discord-link]: https://discord.gg/TNwARpR\n[rlp-npm-badge]: https://img.shields.io/npm/v/rlp.svg\n[rlp-npm-link]: https://www.npmjs.com/package/rlp\n[rlp-issues-badge]: https://img.shields.io/github/issues/ethereumjs/ethereumjs-monorepo/package:%20rlp?label=issues\n[rlp-issues-link]: https://github.com/ethereumjs/ethereumjs-monorepo/issues?q=is%3Aopen+is%3Aissue+label%3A\"package%3A+rlp\"\n[rlp-actions-badge]: https://github.com/ethereumjs/ethereumjs-monorepo/workflows/rlp/badge.svg\n[rlp-actions-link]: https://github.com/ethereumjs/ethereumjs-monorepo/actions?query=workflow%3A%22rlp%22\n[rlp-coverage-badge]: https://codecov.io/gh/ethereumjs/ethereumjs-monorepo/branch/master/graph/badge.svg?flag=rlp\n[rlp-coverage-link]: https://codecov.io/gh/ethereumjs/ethereumjs-monorepo/tree/master/packages/rlp\n","gitHead":"2dd63b91109188e5b4f5b251f47aae756f7e1841","scripts":{"tsc":"../../config/cli/ts-compile.sh","lint":"../../config/cli/lint.sh","tape":"tape -r ts-node/register","test":"npm run test:node && npm run test:browser","build":"../../config/cli/ts-build.sh node","clean":"../../config/cli/clean-package.sh","coverage":"../../config/cli/coverage.sh","lint:fix":"../../config/cli/lint-fix.sh","test:node":"npm run tape -- test/*.spec.ts","test:browser":"karma start karma.conf.js","prepublishOnly":"../../config/cli/prepublish.sh"},"_npmUser":{"name":"holgerd77","email":"Holger.Drewes@gmail.com"},"repository":{"url":"git+https://github.com/ethereumjs/ethereumjs-monorepo.git","type":"git"},"_npmVersion":"8.5.5","description":"Recursive Length Prefix Encoding Module","directories":{},"_nodeVersion":"16.15.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^15.1.0","tape":"^5.3.1","karma":"^6.3.4","ts-node":"^10.2.1","prettier":"^2.4.1","karma-tap":"^4.2.0","typescript":"^4.4.2","@types/node":"^16.11.7","@types/tape":"^4.13.2","karma-typescript":"^5.5.3","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.1"},"_npmOperationalInternal":{"tmp":"tmp/rlp_4.0.0-beta.2_1658073391280_0.5278422461690471","host":"s3://npm-registry-packages"},"publish_time":1658073391532,"_cnpm_publish_time":1658073391532,"dist-tags":{"beta":"4.0.0-beta.2","latest":"3.0.0"}}