{"_id":"@bestinslot/nada","_rev":"7-59cf0672700c64e52c10dc5204a564ef","name":"@bestinslot/nada","dist-tags":{"latest":"0.1.6"},"versions":{"0.1.0":{"name":"@bestinslot/nada","version":"0.1.0","keywords":["solidity","calldata","encoding"],"author":{"name":"Best in Slot"},"license":"Apache-2.0","_id":"@bestinslot/nada@0.1.0","maintainers":[{"name":"alpergundogdu","email":"mail@alpergundogdu.com"}],"homepage":"https://github.com/bestinslot-xyz/nada-js#readme","bugs":{"url":"https://github.com/bestinslot-xyz/nada-js/issues"},"dist":{"shasum":"4bc900c6f0a7872c8fe40a508136025b478ef4fa","tarball":"https://registry.npmjs.org/@bestinslot/nada/-/nada-0.1.0.tgz","fileCount":6,"integrity":"sha512-WaiwVPTKzpWx301Aj/U5INCaIPaf1sSMBVTM2eX+1nCGiBuSch9Z1rl/Xz+7i0gWmIbKXiL9NbI93s/bix6ZNQ==","signatures":[{"sig":"MEYCIQCFYeuxu5KQGjJpQOvI4kBjDGLXf0w+qfvsKz0MCPvc0QIhAIvrNt+crMX4G/Mw3p/O8VTWlw7hHLGxwHnCeO3aEsR6","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15760},"main":"index.js","gitHead":"2082ed92ab91e88bae6964f5d9a89ae6a9972541","scripts":{"test":"uvu -r tsx test","build":"tsc --build","clean":"tsc --build --clean"},"_npmUser":{"name":"alpergundogdu","email":"mail@alpergundogdu.com"},"repository":{"url":"git+https://github.com/bestinslot-xyz/nada-js.git","type":"git"},"_npmVersion":"10.9.2","description":"Compression-focused encoding for zero-heavy solidity calldata and bytecode","directories":{},"_nodeVersion":"23.9.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.3","uvu":"^0.5.6","typescript":"^5.8.3"},"_npmOperationalInternal":{"tmp":"tmp/nada_0.1.0_1745834290885_0.6511846701276625","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@bestinslot/nada","version":"0.1.1","keywords":["solidity","calldata","encoding"],"author":{"name":"Best in Slot"},"license":"Apache-2.0","_id":"@bestinslot/nada@0.1.1","maintainers":[{"name":"alpergundogdu","email":"mail@alpergundogdu.com"}],"homepage":"https://github.com/bestinslot-xyz/nada-js#readme","bugs":{"url":"https://github.com/bestinslot-xyz/nada-js/issues"},"dist":{"shasum":"cde84e812a3d4058f9e4a008d5540d235e328227","tarball":"https://registry.npmjs.org/@bestinslot/nada/-/nada-0.1.1.tgz","fileCount":10,"integrity":"sha512-QWsFRXL9QhnJeis/xBZ0afDDeeAwxZvySMUgXE4tdToDKkmq2gPrpbqYavTkQokX5h8JAiqi96Gb25fchtMQow==","signatures":[{"sig":"MEQCIDyyN80d0rnB9Nya5Q5x5xA0sav9c2obeMXZN2dm/oNiAiAlsWCQRV3F/KEM6oUG8CRzhcaTUcS6fcMcaShiVWftGQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":25319},"main":"dist/src/nada.js","gitHead":"2082ed92ab91e88bae6964f5d9a89ae6a9972541","scripts":{"test":"uvu -r tsx test","build":"tsc --build","clean":"tsc --build --clean"},"_npmUser":{"name":"alpergundogdu","email":"mail@alpergundogdu.com"},"repository":{"url":"git+https://github.com/bestinslot-xyz/nada-js.git","type":"git"},"_npmVersion":"10.9.2","description":"Compression-focused encoding for zero-heavy solidity calldata and bytecode","directories":{},"_nodeVersion":"23.9.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.3","uvu":"^0.5.6","typescript":"^5.8.3"},"_npmOperationalInternal":{"tmp":"tmp/nada_0.1.1_1745834786189_0.085186451897441","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@bestinslot/nada","version":"0.1.2","keywords":["solidity","calldata","encoding"],"author":{"name":"Best in Slot"},"license":"Apache-2.0","_id":"@bestinslot/nada@0.1.2","maintainers":[{"name":"alpergundogdu","email":"mail@alpergundogdu.com"}],"homepage":"https://github.com/bestinslot-xyz/nada-js#readme","bugs":{"url":"https://github.com/bestinslot-xyz/nada-js/issues"},"dist":{"shasum":"a2f0f8193610d38a3c08483ba340f9e19c1b43e5","tarball":"https://registry.npmjs.org/@bestinslot/nada/-/nada-0.1.2.tgz","fileCount":10,"integrity":"sha512-2yBMI6aZ0fg/3UKcUlHKlO9pJRxJ/XfllFYm3s4HLmYv2mBCpqyS+E2aEgkDIzWabi63An8EZCU6KNPeisfLsQ==","signatures":[{"sig":"MEUCIFvKHKD/72tqL29OQt3mjV6jwBgoE2dql5YDqgR2WtCCAiEA3B8K0m3ZE4nU9sNJqSu4QtyEkl3Aqf4ffOeUSORna6Q=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26904},"main":"dist/src/nada.js","gitHead":"2082ed92ab91e88bae6964f5d9a89ae6a9972541","scripts":{"test":"uvu -r tsx test","build":"tsc --build","clean":"tsc --build --clean"},"_npmUser":{"name":"alpergundogdu","email":"mail@alpergundogdu.com"},"repository":{"url":"git+https://github.com/bestinslot-xyz/nada-js.git","type":"git"},"_npmVersion":"10.9.2","description":"Compression-focused encoding for zero-heavy solidity calldata and bytecode","directories":{},"_nodeVersion":"23.9.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.3","uvu":"^0.5.6","typescript":"^5.8.3"},"_npmOperationalInternal":{"tmp":"tmp/nada_0.1.2_1745835133209_0.21011767200325293","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@bestinslot/nada","version":"0.1.3","keywords":["solidity","calldata","encoding"],"author":{"name":"Best in Slot"},"license":"Apache-2.0","_id":"@bestinslot/nada@0.1.3","maintainers":[{"name":"alpergundogdu","email":"mail@alpergundogdu.com"}],"homepage":"https://github.com/bestinslot-xyz/nada-js#readme","bugs":{"url":"https://github.com/bestinslot-xyz/nada-js/issues"},"dist":{"shasum":"1d5118085483f3f6e42a6ed00c9cfe645e8f323a","tarball":"https://registry.npmjs.org/@bestinslot/nada/-/nada-0.1.3.tgz","fileCount":10,"integrity":"sha512-rc8cD4LzPzIuhD8iZnrIPIgqOM2xl7A4QJJUwIv5H8y+VQO6azcVeg+fohv8Obf946LmM45+hDzsCGiLB1nNww==","signatures":[{"sig":"MEUCIQCs2gH0IRbHe+szRT3Pwhc0c1/sH96lA9wJ52QDyV5JmAIgEhmTYeX3VrVwy2Oqd3Pi6LwKf8BPS46kOSNgh6TC+5w=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":28256},"main":"dist/src/nada.js","gitHead":"0aca1b417d2e0ee4fc8450ee7887f3296e48fa71","scripts":{"test":"uvu -r tsx test","build":"tsc --build","clean":"tsc --build --clean"},"_npmUser":{"name":"alpergundogdu","email":"mail@alpergundogdu.com"},"repository":{"url":"git+https://github.com/bestinslot-xyz/nada-js.git","type":"git"},"_npmVersion":"10.9.2","description":"Compression-focused encoding for zero-heavy solidity calldata and bytecode","directories":{},"_nodeVersion":"23.9.0","dependencies":{"@bestinslot/nada":"^0.1.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"4.19.4","uvu":"^0.5.6","typescript":"^5.8.3"},"_npmOperationalInternal":{"tmp":"tmp/nada_0.1.3_1746099195645_0.07295947545439807","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@bestinslot/nada","version":"0.1.4","keywords":["solidity","calldata","encoding"],"author":{"name":"Best in Slot"},"license":"Apache-2.0","_id":"@bestinslot/nada@0.1.4","maintainers":[{"name":"alpergundogdu","email":"mail@alpergundogdu.com"}],"homepage":"https://github.com/bestinslot-xyz/nada-js#readme","bugs":{"url":"https://github.com/bestinslot-xyz/nada-js/issues"},"dist":{"shasum":"f0520105ce245e587d1fa39af7433699f3198a0b","tarball":"https://registry.npmjs.org/@bestinslot/nada/-/nada-0.1.4.tgz","fileCount":10,"integrity":"sha512-WUoSlvW+EHF+blkHeVwAE0aGpkCFyDv+V2kMqTq8UtF0AeLhDOCYZSNyDMrug72K7fNVrA//tSLabgPoUtv50w==","signatures":[{"sig":"MEYCIQCjuvE2mn2RpGLXbHIM29FA3Ap/93FCO0AFsDRcVzLHCQIhAOdbLwHRf9K+quwHaa4fPUWDw59fpJofODmy5QUunQkK","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":31166},"main":"dist/src/nada.js","gitHead":"dfb89e37ba8feda1847b5a130f063de7bddca7c6","scripts":{"test":"uvu -r tsx test","build":"tsc --build","clean":"tsc --build --clean"},"_npmUser":{"name":"alpergundogdu","email":"mail@alpergundogdu.com"},"repository":{"url":"git+https://github.com/bestinslot-xyz/nada-js.git","type":"git"},"_npmVersion":"10.9.2","description":"Compression-focused encoding for zero-heavy solidity calldata and bytecode","directories":{},"_nodeVersion":"23.9.0","dependencies":{"@bestinslot/nada":"^0.1.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"4.19.4","uvu":"^0.5.6","typescript":"^5.8.3"},"_npmOperationalInternal":{"tmp":"tmp/nada_0.1.4_1746099279679_0.6277437223723175","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"@bestinslot/nada","version":"0.1.5","keywords":["solidity","calldata","encoding"],"author":{"name":"Best in Slot"},"license":"Apache-2.0","_id":"@bestinslot/nada@0.1.5","maintainers":[{"name":"alpergundogdu","email":"mail@alpergundogdu.com"}],"homepage":"https://github.com/bestinslot-xyz/nada-js#readme","bugs":{"url":"https://github.com/bestinslot-xyz/nada-js/issues"},"dist":{"shasum":"aaa4914d18bca5a0b772d3406be2d1d741bab0eb","tarball":"https://registry.npmjs.org/@bestinslot/nada/-/nada-0.1.5.tgz","fileCount":10,"integrity":"sha512-GOmpdovwzI5T0HAckZzBQSpzDCKEKgIMCdxWGsImXXViuZAfRkNHRq4XDz6PcOWZlrQZFsnA8V6c1PJPzS/FnQ==","signatures":[{"sig":"MEUCICfnyjL/IazSnOTBs6qzk0OT2e+lusmo3qjSVSi6MCr+AiEA/VyBfpDSEQipLcNirlytAB6TxHgddf8maTFf2ojA+sk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":31209},"main":"dist/src/nada.js","types":"dist/types/src/nada.d.ts","gitHead":"4305dba8f39e67516f1a41f82d6c6862c273e725","scripts":{"test":"uvu -r tsx test","build":"tsc --build","clean":"tsc --build --clean"},"_npmUser":{"name":"alpergundogdu","email":"mail@alpergundogdu.com"},"repository":{"url":"git+https://github.com/bestinslot-xyz/nada-js.git","type":"git"},"_npmVersion":"10.9.2","description":"Compression-focused encoding for zero-heavy solidity calldata and bytecode","directories":{},"_nodeVersion":"23.9.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"4.19.4","uvu":"^0.5.6","typescript":"^5.8.3"},"_npmOperationalInternal":{"tmp":"tmp/nada_0.1.5_1749462513227_0.11447626255142795","host":"s3://npm-registry-packages-npm-production"}},"0.1.6":{"name":"@bestinslot/nada","version":"0.1.6","description":"Compression-focused encoding for zero-heavy solidity calldata and bytecode","main":"dist/src/nada.js","types":"dist/types/src/nada.d.ts","scripts":{"test":"uvu -r tsx test","build":"tsc --build","clean":"tsc --build --clean"},"repository":{"type":"git","url":"git+https://github.com/bestinslot-xyz/nada-js.git"},"keywords":["solidity","calldata","encoding"],"author":{"name":"Best in Slot"},"license":"Apache-2.0","bugs":{"url":"https://github.com/bestinslot-xyz/nada-js/issues"},"homepage":"https://github.com/bestinslot-xyz/nada-js#readme","devDependencies":{"tsx":"4.19.4","typescript":"^5.8.3","uvu":"^0.5.6"},"publishConfig":{"access":"public"},"_id":"@bestinslot/nada@0.1.6","gitHead":"a7b149a6a37a96a6599b0c49385b6b8c2bc14eca","_nodeVersion":"23.9.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-YzQPgFmRz5l1dAa461i7KPmrBbm7U/9HJI96mLp2wqiHZCjqU1WbZooRaeRV8avWNAWp8NYq6in5FNafJM2pDw==","shasum":"e43cf50d54268612d81246a5dafb9a9b607d46a9","tarball":"https://registry.npmjs.org/@bestinslot/nada/-/nada-0.1.6.tgz","fileCount":12,"unpackedSize":31435,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCyi2L7xrCErmj3wB1pVFI0saJTiJSLhryPOTrygCqN3wIgTpCv4Kq8NbxIpQikNJAil2mmPAlGmPs7q5VASPWb42U="}]},"_npmUser":{"name":"alpergundogdu","email":"mail@alpergundogdu.com"},"directories":{},"maintainers":[{"name":"alpergundogdu","email":"mail@alpergundogdu.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/nada_0.1.6_1749556587584_0.9734850189333946"},"_hasShrinkwrap":false}},"time":{"created":"2025-04-28T09:58:10.778Z","modified":"2025-06-10T11:56:27.967Z","0.1.0":"2025-04-28T09:58:11.043Z","0.1.1":"2025-04-28T10:06:26.401Z","0.1.2":"2025-04-28T10:12:13.377Z","0.1.3":"2025-05-01T11:33:15.843Z","0.1.4":"2025-05-01T11:34:39.931Z","0.1.5":"2025-06-09T09:48:33.414Z","0.1.6":"2025-06-10T11:56:27.783Z"},"bugs":{"url":"https://github.com/bestinslot-xyz/nada-js/issues"},"author":{"name":"Best in Slot"},"license":"Apache-2.0","homepage":"https://github.com/bestinslot-xyz/nada-js#readme","keywords":["solidity","calldata","encoding"],"repository":{"type":"git","url":"git+https://github.com/bestinslot-xyz/nada-js.git"},"description":"Compression-focused encoding for zero-heavy solidity calldata and bytecode","maintainers":[{"name":"alpergundogdu","email":"mail@alpergundogdu.com"}],"readme":"# nada\n\nCompression-focused encoding for zero-heavy Solidity calldata and bytecode.\n\n`nada` provides an efficient way to encode and decode byte arrays where runs of `0x00` are replaced with a compact marker (`0xFF`) followed by the length of the run. This is particularly useful for reducing the size of calldata and bytecode in environments like Ethereum.\n\n## How it Works\n\n- `0xFF 0x00` is a reserved sequence\n- `0xFF 0x01` encodes a single `0xFF`\n- `0xFF 0x02` encodes a double `0xFF`\n- `0xFF N` (3 ≤ N ≤ 255) encodes `N` zero bytes\n- All other bytes are passed through unchanged\n\nThis encoding helps reduce the size of sequences with a high proportion of zero bytes, which are common in Solidity calldata and bytecode.\n\n### Example\n\n| Input                          | Encoded                          |\n|--------------------------------|----------------------------------|\n| `[0x00, 0x00, 0x02, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF]`    | `[0x00, 0x00, 0x02, 0xFF, 0x02, 0xFF, 0x04, 0xFF, 0x01]` |\n\n\n## Installation\n\nTo add `nada` to your project, use\n\n```bash\n> npm add @bestinslot/nada\n```\n\n### Usage\nHere is a simple example of how to use the encode and decode functions:\n\n```javascript\nimport {encode, decode} from \"@bestinslot/nada\";\n\nlet array = new Uint8Array([1, 0, 0, 0, 255, 0, 0]);\n\nlet encoded = encode(array);\nlet decoded = decode(encoded);\n```\n\n`decode` returns an error if the input ends unexpectedly, such as when a `0xFF` marker is found without a following run length byte, indicating incomplete or malformed encoded data. It also returns an error if the reserved sequence `0xFF00` is encountered.\n\n### License\n\nApache License, Version 2.0\n","readmeFilename":"README.md"}