{"_id":"@bradthomasbrown/rlp","name":"@bradthomasbrown/rlp","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@bradthomasbrown/rlp","description":"Minimal, unoptimized, and unaudited recursive-length prefix (RLP) serialization library in JavaScript/TypeScript.","version":"1.0.0","author":{"name":"Brad Brown","email":"https://t.me/bradthomasbrown"},"type":"module","exports":{".":"./dist/rlp.js"},"_id":"@bradthomasbrown/rlp@1.0.0","gitHead":"a7291f983f69ef8c5db8378efcef2ad0578fe0a9","_nodeVersion":"22.16.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-XoFHsXsIhwVfkgwneB9K75ydSR2vTW+EdoomgZOPzntSY0umkeOlqIhPvt1nus6SvqjfwgtmuwXJbMxshmXZag==","shasum":"e6df9d1bf309e638b7f41b49ffe228a8b0feefb6","tarball":"https://registry.npmjs.org/@bradthomasbrown/rlp/-/rlp-1.0.0.tgz","fileCount":5,"unpackedSize":8717,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDwWNDB2HxxaMAaKA4yhX4iGQ/6HYo4QXRr+nZgaEw6yQIhAJ0stmMX7Bx2XB9pg/1g5trbB3gqQ2kN64vu/beud0sC"}]},"_npmUser":{"name":"bradthomasbrown","email":"bradthomasbrown@outlook.com"},"directories":{},"maintainers":[{"name":"bradthomasbrown","email":"bradthomasbrown@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/rlp_1.0.0_1765333445117_0.1766219256893684"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-10T02:24:05.018Z","1.0.0":"2025-12-10T02:24:05.255Z","modified":"2025-12-10T02:24:05.527Z"},"maintainers":[{"name":"bradthomasbrown","email":"bradthomasbrown@outlook.com"}],"description":"Minimal, unoptimized, and unaudited recursive-length prefix (RLP) serialization library in JavaScript/TypeScript.","author":{"name":"Brad Brown","email":"https://t.me/bradthomasbrown"},"readme":"# rlp\r\nThis is a simple, minimal implementation of recursive-length prefix serialization in TypeScript/JavaScript. \r\n\r\n## Why?\r\nThere is surprisingly little information on all aspects of the \"cryptographic stack\" in JavaScript and elsewhere that is simple and minimal. This repository is part of a series of repositories that builds up this stack from first principles, including:\r\n- [Finite field arithmetic](https://github.com/bradthomasbrown/finite-field)\r\n- [Elliptic curves over finite fields](https://github.com/bradthomasbrown/finite-curve)\r\n- [Sponge constructions and Keccak](https://github.com/bradthomasbrown/keccak)\r\n- The concrete instances of secp256k1, Keccak-256, and more as well as how these are made from the above concepts\r\n- Recursive-length prefix serialization (this library)\r\n- ECDSA\r\n- Interacting with EVM nodes\r\n- And potentially more\r\n\r\n## Installation\r\n```sh\r\nnpm i @bradthomasbrown/rlp\r\n```\r\n\r\n## Usage\r\n```js\r\nimport { encode } from \"@bradthomasbrown/rlp\";\r\n\r\nconst T = new TextEncoder();\r\n\r\nconsole.log(encode(T.encode(\"dog\")).toHex());\r\n// 83646f67\r\n\r\nconsole.log(encode([T.encode(\"cat\"), T.encode(\"dog\")]).toHex());\r\n// c88363617483646f67\r\n\r\nconsole.log(encode(new Uint8Array()).toHex());\r\n// 80\r\n\r\nconsole.log(encode([]).toHex());\r\n// c0\r\n\r\nconsole.log(encode(0n).toHex());\r\n// 80\r\n\r\nconsole.log(encode(new Uint8Array([0x00])).toHex());\r\n// 00\r\n\r\nconsole.log(encode(new Uint8Array([0x0f])).toHex());\r\n// 0f\r\n\r\nconsole.log(encode(new Uint8Array([0x04, 0x00])).toHex());\r\n// 820400\r\n\r\nconsole.log(encode([ [], [[]], [ [], [[]] ] ]).toHex());\r\n// c7c0c1c0c3c0c1c0\r\n\r\nconsole.log(encode(T.encode(\"Lorem ipsum dolor sit amet, consectetur adipisicing elit\")).toHex());\r\n// b8384c6f72656d20697073756d20646f6c6f722073697420616d65742c20636f6e7365637465747572206164697069736963696e6720656c6974\r\n```","readmeFilename":"README.md","_rev":"1-f5500101da0b5d2dc5f68fa0f0ca840e"}