{"name":"@ethereumjs/rlp","version":"4.0.0-beta.3","description":"Recursive Length Prefix Encoding Module","keywords":["rlp","ethereum"],"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"},"repository":{"type":"git","url":"git+https://github.com/ethereumjs/ethereumjs-monorepo.git"},"license":"MPL-2.0","author":{"name":"martin becze","email":"mjbecze@gmail.com"},"contributors":[{"name":"Alex Beregszaszi","email":"alex@rtfs.hu"},{"name":"Holger Drewes","email":"Holger.Drewes@gmail.com"},{"name":"Paul Miller","email":"pkg@paulmillr.com"}],"main":"dist/index.js","types":"dist/index.d.ts","bin":{"rlp":"bin/rlp"},"scripts":{"build":"../../config/cli/ts-build.sh node","clean":"../../config/cli/clean-package.sh","coverage":"../../config/cli/coverage.sh","lint":"../../config/cli/lint.sh","lint:diff":"../../config/cli/lint-diff.sh","lint:fix":"../../config/cli/lint-fix.sh","prepublishOnly":"../../config/cli/prepublish.sh","tape":"tape -r ts-node/register","test":"npm run test:node && npm run test:browser","test:browser":"karma start karma.conf.js","test:node":"npm run tape -- test/*.spec.ts","tsc":"../../config/cli/ts-compile.sh"},"devDependencies":{"@types/node":"^16.11.7","@types/tape":"^4.13.2","karma":"^6.3.4","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.1","karma-tap":"^4.2.0","karma-typescript":"^5.5.3","nyc":"^15.1.0","tape":"^5.3.1","ts-node":"^10.2.1","typescript":"^4.4.2"},"gitHead":"8c1d34d43119819fcd4da4c44e07b7c2ca1f807b","_id":"@ethereumjs/rlp@4.0.0-beta.3","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-pvQqtxPJCn2vxm8AJtKUv7+IOqgOb5gf+4xhO5qcRDXzk6Ef/RX+g1xzA3Dss/wd/jV4nPN1jUGHjsIzhtp4EQ==","shasum":"61ad6a535c03e0281f8ddf72a3dbd64b2a3d78da","tarball":"http://registry-npm.ywwl.com/@ethereumjs/rlp/download/@ethereumjs/rlp-4.0.0-beta.3.tgz","fileCount":9,"unpackedSize":51328,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBxPF0W1qm9Ajl/qCRNAyt94GyOlg3xC+9EiIXMLjSjWAiBmTJSvsfOtJ2NGJ2dqcCV/bo+KSa9pQmYh+MaV76hXSQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi9R2/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoLCg/+KGbXg3tgzJ5N2OW+1DkajMjuVO8QcCKxImXlMVzlsTFy3IBv\r\nmOxzeOM1QLhG1hRr00q3fS/zNBV3PMnR/jgBoLPMs7z0uKd/EFgadxni1mIu\r\n7/ykR8r5qGWyX7wnyZIt69uSIeKk1GEWmDZ7GeIdiI3m4020RNiwIbNHheBI\r\nvbAx29qlUc3QNZ6kIntTzpUspRu9Tzw4JyEUJ3qw8V6itaPvCldywpgH6vQV\r\n99+2nUlfLzyvkd/jnWZXQA2Ef4ShnT92OCXY8hRnmeyoR4UDXL+FMMrcUFB0\r\nRh+0l646dAvN8q1QwOApaWFVEgTDjeicOg9y4DR1Fxnke+5xqxYl4OCcGtMj\r\nbLZTQnc0ABhFQ+s9LxCBdEIsC5aIexx3lu5P0IW0TOsOjmvHciD9PvcCSzA7\r\nga4DzFqcl3pEEGJChk8uu6W+cf0NvWNj5YjCaet6IKkHGlcN9VoI2sOnLlr+\r\n5mTRFWPtvqwYQrMGihBTVSX2qNXFRHGhIc5dfTuqqbstyiTYw36Ad9uk/ELF\r\nNh/kR1S/fFXrqNc8TdnE0T+SRtPiBL3iGa4VZ1HR333CfrfgYk+Ax4CpmeKZ\r\np64dFB5mTMynbPeTGpEw4eowamdjAHE3pBXDaSZY7WTxhj+dF1Yz96dqubv2\r\n0E1tdXdjTSE5YYL6nMEXQ+DfY4iYccR2cRw=\r\n=hFbQ\r\n-----END PGP SIGNATURE-----\r\n","size":13882,"noattachment":false,"key":"/@ethereumjs/rlp/-/@ethereumjs/rlp-4.0.0-beta.3.tgz"},"_npmUser":{"name":"holgerd77","email":"Holger.Drewes@gmail.com"},"directories":{},"maintainers":[{"name":"axic","email":"alex@rtfs.hu"},{"name":"holgerd77","email":"Holger.Drewes@gmail.com"},{"name":"ralxz","email":"ryan@ryanio.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rlp_4.0.0-beta.3_1660231103559_0.19294221810833667"},"_hasShrinkwrap":false,"readme":"# @ethereumjs/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://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp) encoding for Node.js and the browser. |\n| ----------------------------------------------------------------------------------------------------------------------------------------- |\n\n## Installation\n\nTo obtain the latest version, simply require the project using `npm`:\n\n```shell\nnpm install @ethereumjs/rlp\n```\n\nInstall with `-g` if you want to use the CLI.\n\n## Usage\n\n```ts\n// ./examples/simple.ts\n\nimport assert from 'assert'\nimport { RLP } from '@ethereumjs/rlp'\n\nconst nestedList = [[], [[]], [[], [[]]]]\nconst encoded = RLP.encode(nestedList)\nconst decoded = RLP.decode(encoded)\nassert.deepStrictEqual(decoded, nestedList, 'decoded output does not match original')\nconsole.log('assert.deepStrictEqual would have thrown if the decoded output did not match')\n```\n\n## Browser\n\nWith the breaking release round in Summer 2023 we have added hybrid ESM/CJS builds for all our libraries (see section below) and have eliminated many of the caveats which had previously prevented a frictionless browser usage.\n\nIt is now easily possible to run a browser build of one of the EthereumJS libraries within a modern browser using the provided ESM build. For a setup example see [./examples/browser.html](./examples/browser.html).\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 -> Uint8Array\n\nWith the breaking releases from Summer 2023 we have removed all Node.js specific `Buffer` usages from our libraries and replace these with [Uint8Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) representations, which are available both in Node.js and the browser (`Buffer` is a subclass of `Uint8Array`).\n\nWe have converted existing Buffer conversion methods to Uint8Array conversion methods in the [@ethereumjs/util](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/util) `bytes` module, see the respective README section for guidance.\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## 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. If you want to join for work or carry out improvements on the libraries, please review our [contribution guidelines](https://ethereumjs.readthedocs.io/en/latest/contributing.html) first.\n\n## License\n\n[MPL-2.0](<https://tldrlegal.com/license/mozilla-public-license-2.0-(mpl-2)>)\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/@ethereumjs/rlp.svg\n[rlp-npm-link]: https://www.npmjs.com/package/@ethereumjs/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","publish_time":1660231103785,"_cnpm_publish_time":1660231103785,"dist-tags":{"alpha":"6.0.0-alpha.1","beta":"4.0.0-beta.3","latest":"10.1.3","nightly":"10.1.1-nightly.2","rc":"10.0.0-rc.1"}}