{"name":"index-encoder","version":"1.0.0","author":{"url":"@mafintosh","name":"Mathias Buus"},"license":"MIT","_id":"index-encoder@1.0.0","homepage":"https://github.com/holepunchto/index-encoder","bugs":{"url":"https://github.com/holepunchto/index-encoder/issues"},"dist":{"shasum":"72a81c0d76d8ad25c5ca4c221f4d195a7355b9e5","tarball":"http://registry-npm.ywwl.com/index-encoder/download/index-encoder-1.0.0.tgz","fileCount":5,"integrity":"sha512-e2ZQgSFTAMlOEF+gK/i4hyMBUYiWt8+NHBWTFCUlMBZJMi+HIlyqMC52Q9nQxWXBjZqnCeORt0ReWhJNH8nkqw==","signatures":[{"sig":"MEYCIQCfhaIxuil+MzBTbGdz/KJb0v9MiZEVCUN5hwiUxTFh/gIhAJjvGUYqDJ0B4hKC6C5riNcidjgtuho7psLOyYIhWoiM","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6535,"size":2548,"noattachment":false,"key":"/index-encoder/-/index-encoder-1.0.0.tgz"},"main":"index.js","gitHead":"1988d7bdb25adee64789e107f0ec1440a0cd90af","scripts":{"test":"standard"},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"repository":{"url":"git+https://github.com/holepunchto/index-encoder.git","type":"git"},"_npmVersion":"8.15.0","description":"Encode multiple values into sorted keys","directories":{},"_nodeVersion":"16.17.0","dependencies":{"b4a":"^1.6.4"},"_hasShrinkwrap":false,"devDependencies":{"standard":"^17.0.0"},"_npmOperationalInternal":{"tmp":"tmp/index-encoder_1.0.0_1683380076034_0.6369764806631593","host":"s3://npm-registry-packages"},"readme":"# index-encoder\n\nEncode multiple values into sorted keys\n\n```\nnpm install index-encoder\n```\n\n## Usage\n\n``` js\nconst IndexEncoder = require('index-encoder')\n\nconst idx = new IndexEncoder([\n  IndexEncoder.STRING,\n  IndexEncoder.UINT\n])\n\nconst buf = idx.encode(['foo', 42])\nconsole.log(idx.decode(buf)) // ['foo', 42]\n\n// pass any compact encoding name to map it to the relevant encoding\nconst uintType = IndexEncoder.lookup('uint')\nconst bufferType = IndexEncoder.lookup('buffer')\nconst alsoBufferType = IndexEncoder.lookup('fixed32')\n```\n\n## License\n\nApache 2.0\n","publish_time":1683380076357,"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_cnpm_publish_time":1683380076357,"dist-tags":{"latest":"3.5.0"}}