{"bugs":{"url":"https://github.com/trufflesuite/ganache-core/issues"},"dist":{"shasum":"497bf6b49acdd38e9d899a156d473ac575e26fa4","tarball":"https://registry.npmjs.org/@ganache/rlp/-/rlp-0.1.1-canary.1307.tgz","fileCount":13,"integrity":"sha512-XmPfK8PuNqfa2QwjsapvDJu1qoxC8bdyoa4xRWssP4s7oZW+N0A7P1CQHMfxx3MDCETOJPc01wQ1AndwH6oaDw==","signatures":[{"sig":"MEUCIQCC6CtPyzKjKtzyGDQUpSEYleK7pRzqwjdme+FRaW5cfwIgQorSQWCdSagSnl6wdVm7T9gv6nPi3D1mczAqWhtbpoY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":174008,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhDKXNCRA9TVsSAnZWagAA2jkP/3Oe9uaX7x8sTO/8XvT6\nLENRCPDZnkA0/EEapeKfBFjyJv28Zj9lPIYAqTD40Ziwa/N29F1g/e/PgpH0\nEGhF1RubgNF7V35qYkkes5gDjAAV7TEyWALZ6tW2gbYx2V0/5zpZjfucJst0\n+roZQjyaJdkPwFNE1IS8GUhZUEl8ZT8NQZFNihQXYHAqvtUMeQm/QNtkGzJI\njWTVS46KnObUFTfEg5uuNpb+kkY0QZjEVgUQdNbBSsskJvuk3d7P5+echnUq\nngCF/sJu1eRXQtZZekYasGkErZW0itsogx9P5zTTnJ2MXW1ItsWNXj1nXvoW\nOQsWN3jWxJn3HGL7vibBHSOQp46rAVnwkIPPXCfUacPYOTx+WNCaMIsphpRS\nnPfdrn0bYpCBNcIXHDUJslXanm/SkC8h9X2ANqQihA/Ceakz/KBZcq7mspVE\noqVWoAu/uQ0ZegmFuQgYmDXJwTZ5HiGdu9GdnE5sQVCh5g11W6rdNIKFXRWB\n0/wm+hhBt3r/g6KIio+NzyHIoFVsWwAXlUIrX2obsG2sZgbW+gARnCeMh/vH\nqJeg5UeX9M1szsmBCkF0C8TCBsA9m3kOQp76LYwvlaAigGm1B+jTS2pYC9yb\nExrIlFCSjRqETG0hcQxCH7J1KWigxSHHNoIwux7YhN2y/HYJ3wl9J0J8196y\nFaaj\r\n=ARRg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","name":"@ganache/rlp","author":{"name":"David Murdoch"},"readme":"# `@ganache/rlp`\n\n[Recursive Length](https://github.com/ethereum/wiki/wiki/RLP) Prefix Encoding\nfor Node.js.\n\nBased on https://github.com/ethereumjs/rlp, with some additional optimizations\nfor encoding:\n\n```typescript\nfunction encodeRange<\n  T extends EncodingInput | Readonly<EncodingInput>,\n  Start extends RangeOf<T[\"length\"]>\n>(\n  items: T,\n  start: Start,\n  length: Exclude<Remainders<T[\"length\"], Start>, 0>\n): { length: number; output: Buffer[] } {\n  //...;\n}\n```\n\nBegin RLP encoding of `items`, from `start` until `length`. Call `RLP.digest` to\nfinish encoding.\n\nReturns an object containing the total `length` of all data in the encoded parts,\nand `output`, an array of encoded Buffers.\n\n```typescript\nfunction digest(ranges: Readonly<Buffer[]>[], length: number) {\n  // ...\n}\n```\n\nFinishes encoding started by `encodeRange`.\n\nReturns a Buffer of encoded data.\n\nAdditional changes:\n\n- minor optimisations to `encode`\n- `encode` only accepts buffers or nested buffer arrays, strings, number, bigint,\n  and BN support have been removed.\n\n---\n\nThese changes enable encoding data in chunks, avoiding processing the same\ninputs multiple times in common scenarios withing Ganache. Example:\n\n```typescript\ntype EthereumRawTx = [\n  nonce: Buffer,\n  gasPrice: Buffer,\n  gas: Buffer,\n  to: Buffer,\n  value: Buffer,\n  data: Buffer,\n  v: Buffer,\n  r: Buffer,\n  s: Buffer\n];\n// encode the first 6 entries\nconst partialRlp = encodeRange(raw, 0, 6);\n// encode the last 3 entires\nconst signature = encodeRange(raw, 6, 3);\n// combine all entries\nconst serialized = digest(\n  [partialRlp.output, signature.output],\n  partialRlp.length + signature.length\n);\nreturn {\n  // computing the `from` address requires entries 0-6\n  from: computeFromAddress(partialRlp, v.toNumber(), raw, chainId),\n  // hash requires entries 0-9\n  hash: Data.from(keccak(serialized), 32),\n  // serialized uses all entries for storage/transmission\n  serialized\n};\n```\n","source":"index.ts","gitHead":"edabb55b11e1bbba3564f34434f4b414bbcd41a4","license":"MIT","scripts":{"tsc":"ttsc --build","test":"nyc npm run mocha","mocha":"cross-env TS_NODE_COMPILER=ttypescript TS_NODE_FILES=true mocha --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register 'tests/**/*.test.ts'"},"typings":"typings","_npmUser":{"name":"davidmurdoch","email":"david@davidmurdoch.com"},"homepage":"https://github.com/trufflesuite/ganache-core/tree/develop/src/packages/rlp#readme","keywords":["ganache","ganache-rlp","ethereum","evm","blockchain","smart contracts","dapps","solidity","vyper","fe","web3","tooling","truffle"],"repository":{"url":"git+https://github.com/trufflesuite/ganache-core.git","type":"git","directory":"src/packages/rlp"},"_npmVersion":"lerna/4.0.0/node@v14.17.4+x64 (linux)","description":"Recursive Length Prefix Encoding Module","directories":{"lib":"lib","test":"test"},"maintainers":[{"name":"davidmurdoch","email":"david@davidmurdoch.com"},{"name":"micaiahreid","email":"micaiahreid@gmail.com"}],"_nodeVersion":"14.17.4","dependencies":{"rlp":"2.2.6","@ganache/utils":"0.1.1-canary.1307+edabb55b"},"publishConfig":{"access":"public"},"_hasShrinkwrap":true,"readmeFilename":"README.md","devDependencies":{"nyc":"15.1.0","mocha":"8.4.0","ts-node":"9.0.0","cross-env":"7.0.2","typescript":"4.1.3","ttypescript":"1.5.12","@types/mocha":"8.2.2"},"_npmOperationalInternal":{"tmp":"tmp/rlp_0.1.1-canary.1307_1628218828863_0.8446743541952233","host":"s3://npm-registry-packages"},"_id":"@ganache/rlp@0.1.1-canary.1307","version":"0.1.1-canary.1307"}