{"_id":"protocol-buffers-encodings","_rev":"4-e55c93c3ef3055465eba6365a6b88b1e","name":"protocol-buffers-encodings","description":"Base encodings for protocol-buffers","dist-tags":{"latest":"1.2.0"},"versions":{"1.0.0":{"name":"protocol-buffers-encodings","version":"1.0.0","description":"Base encodings for protocol-buffers","main":"index.js","dependencies":{"signed-varint":"^2.0.1","varint":"^5.0.0"},"devDependencies":{"standard":"^10.0.3","tape":"^4.8.0"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/protocol-buffers-encodings.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/protocol-buffers-encodings/issues"},"homepage":"https://github.com/mafintosh/protocol-buffers-encodings","gitHead":"cb915adebecd857bfe6a295841c33e00be8e134c","_id":"protocol-buffers-encodings@1.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"integrity":"sha512-Cp6YLfXR30nlMsYLKAjMMjFbrVFGYOHG54iDpwAkkPqkpfrDXHPoRVmw80koLK5CgFW163V5fUTTzYj0Oq7NVQ==","shasum":"46483d698e77afb5c7ec8fb59503d48ed5f6e83c","tarball":"https://registry.npmjs.org/protocol-buffers-encodings/-/protocol-buffers-encodings-1.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDDjI0KFxohqqKmKR+UXx9R7FSnBjssucHIfJ38SBj9PAIgChOA43QUscGwVhSThOpizH+d8zHzsXyYhtEDaQ8Z2Ng="}]},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/protocol-buffers-encodings-1.0.0.tgz_1516196700071_0.665986459236592"},"directories":{}},"1.1.0":{"name":"protocol-buffers-encodings","version":"1.1.0","description":"Base encodings for protocol-buffers","main":"index.js","dependencies":{"signed-varint":"^2.0.1","varint":"^5.0.0"},"devDependencies":{"standard":"^10.0.3","tape":"^4.8.0"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/protocol-buffers-encodings.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/protocol-buffers-encodings/issues"},"homepage":"https://github.com/mafintosh/protocol-buffers-encodings","gitHead":"7768744fec6c452de27ed1f9212bf526d443d4ad","_id":"protocol-buffers-encodings@1.1.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"integrity":"sha512-SmjEuAf3hc3h3rWZ6V1YaaQw2MNJWK848gLJgzx/sefOJdNLujKinJVXIS0q2cBQpQn2Q32TinawZyDZPzm4kQ==","shasum":"f3905631106669b85381bad47a336add7d206873","tarball":"https://registry.npmjs.org/protocol-buffers-encodings/-/protocol-buffers-encodings-1.1.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCWpSIhW6rRapX81C/fg29NOZrWDpKktcupfmaRFSbxXQIgME0GRM1XaggcXMOJHxKFVHQHcztOlTdvwGVDMKPMwBQ="}]},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/protocol-buffers-encodings-1.1.0.tgz_1516197198069_0.15216099540703"},"directories":{}},"1.1.1":{"name":"protocol-buffers-encodings","version":"1.1.1","description":"Base encodings for protocol-buffers","main":"index.js","dependencies":{"signed-varint":"^2.0.1","varint":"5.0.0"},"devDependencies":{"standard":"^14.3.4","tape":"^5.0.1"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/protocol-buffers-encodings.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/protocol-buffers-encodings/issues"},"homepage":"https://github.com/mafintosh/protocol-buffers-encodings","gitHead":"d5cc37b7477c5092b8b4c4da837b8e38b4949108","_id":"protocol-buffers-encodings@1.1.1","_nodeVersion":"14.10.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-5aFshI9SbhtcMiDiZZu3g2tMlZeS5lhni//AGJ7V34PQLU5JA91Cva7TIs6inZhYikS3OpnUzAUuL6YtS0CyDA==","shasum":"f1e4a386711823137330171d2c82b49d062e75d3","tarball":"https://registry.npmjs.org/protocol-buffers-encodings/-/protocol-buffers-encodings-1.1.1.tgz","fileCount":6,"unpackedSize":12684,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcfJOCRA9TVsSAnZWagAAwXcQAIgERcYtp0n8x9+uPlZ0\nteSjdLyOyD+u7nDX/soPs0Lvlhze5rAukrIzLzXAp3hqN9Ijp3BGrGV2tbS2\nhbyVbNPYZntac8n56XlhWR6BSjYKl/pBM5Gt+CtJAt3isV5atA0WeEuSiTUu\n8Z0uXd1ctrc6G0Xmj4/n3blmWIezB2jozz6jKSRg+/d4QOBu7ogJ0w/DMCkC\nhFmNVL15qWu4KmliDNW/I51HbnC6u31E9hR71SM93QDz5oi33lN+8qRQO7KD\nCKmWXKBsJxzCRvy9no3Aw28SNp1/JFQbJEGcIShYJ82jL6KxzzMeb+ZZtVhM\n6uaKNZr3Eq2WzQoxbz2X0612STmAL4NePOMgjFcJKXg/ap19QYAHDMooMivu\nzTK2d4kYaRZyN6D3aLGLYU4HnCbVY0lQJFPFxPHRf4AfDg+Go4rHsihmzrfS\n9AJPMk2IhIEc6WUdujk8zkZlTseEz7c1/7+TAsi8qzqT/fY5PilPdpwNrNGl\nPWdKuv2zUR2SWMdcAx1SvTyBgh7iS5mi2CjNaAGEYfMQ9PWTj95771JmgJWL\nrIMXUzW5K4EKhOFogdHX8k4OpUB/1Ig/e/oAFRwUS4TZJhR/+a6FrVCf2yg7\noBIfSbsWoss9ybaKANfc07DIKBXxFTjG5H+OLXGpyJHvIvFhExj5z9wONU9G\nxe95\r\n=7EpG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBo/I7/6xmFxNmqTRj9Vi3m6ZYggs5WkyZ346XAj493jAiALYgP4wco1VKULxq6nonQrwKcp7KVR6+eqNrGSGHLWWQ=="}]},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/protocol-buffers-encodings_1.1.1_1601303118327_0.09241571471301246"},"_hasShrinkwrap":false},"1.2.0":{"name":"protocol-buffers-encodings","version":"1.2.0","description":"Base encodings for protocol-buffers","main":"index.js","dependencies":{"b4a":"^1.6.0","signed-varint":"^2.0.1","varint":"5.0.0"},"devDependencies":{"standard":"^14.3.4","tape":"^5.0.1"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/protocol-buffers-encodings.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/protocol-buffers-encodings/issues"},"homepage":"https://github.com/mafintosh/protocol-buffers-encodings","gitHead":"59bc47d9c5cae4bda1dcb5db92c30f56bbe65d70","_id":"protocol-buffers-encodings@1.2.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-daeNPuKh1NlLD1uDfbLpD+xyUTc07nEtfHwmBZmt/vH0B7VOM+JOCOpDcx9ZRpqHjAiIkGqyTDi+wfGSl17R9w==","shasum":"39900b85dcff3172a23f15bdf3fda70daa2b38d3","tarball":"https://registry.npmjs.org/protocol-buffers-encodings/-/protocol-buffers-encodings-1.2.0.tgz","fileCount":6,"unpackedSize":14407,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB4Ux0ZvaUFRQ3JqVcU6if2/NVg83qEnUPbyofwLXt3JAiAeDKLeNHxaRQL4coo5UDBo6DVgDK8y+R/yE8pbRG9PBA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6WU4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpIcg/+KmzRc12Kpv6fcjDo5DpmUoaIqRH3w46sIbSVyzasouECeJ8W\r\nxNIUspBF80lN5OUcbpnIdd5CEkubPsUIumHIBWkHr0iBDoq7pY99TgR8/06o\r\nvVRf9Aij94ySQRT+5YOLy1w1e9a+UH8qQa1mMM1/ECw9iquXl4rGG/5kBC8c\r\nF2nc+07mbRI60gRZM5H/lipHSSW/bjDrX5zVCJFH+CvwL3Z5Wvgq/o8csIRq\r\nRMVQseCzwwFu89Kf5fvu80zV8Hz3vjTUEMVxl+DLqVX83IQYrPWbdWmFNO07\r\nwDM93siYxmU8VjedcN33Zn9KkO71k1oil3qzQ80EbogOo+e+LZHQ4YQcE/po\r\n9SrCpATfGGmwwIHlAkVsknNLNQQbk17twyrTTDsFuttq03pZyljTOTzhr8H3\r\nKfiwLZPKLbQ76disdaesjRtt/rj6g4gVemnXP/eKFq09kbuRLy2OWptX+hBo\r\nSQlWTf6iwH3RSOcKbaq6yjZZwjhawbMe4z60AzZH1a5hj0avEBKKLhJOJ1fS\r\nKkAsZbsjtJyEC+u1CIjldKKt2kcVfh71TyeFLuWt5yHG9mWSuSoTfdT4kvJC\r\nCA5eSEAbQv4wW8hetPdTh5+MSoblkQE+fqiW2qnPt/8bB6DwGou4KWoFHAma\r\nAuvbDbghLdWhwtmlvimM0xToMV6vK0DmEz8=\r\n=XRZ+\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/protocol-buffers-encodings_1.2.0_1659462968697_0.5356515523497922"},"_hasShrinkwrap":false}},"readme":"# protocol-buffers-encodings\n\nBase encodings for [protocol-buffers](https://github.com/mafintosh/protocol-buffers).\n\n```\nnpm install protocol-buffers-encodings\n```\n\nNote: use Node.js >= 16.15.0 to avoid a performance regression due to a slower `Buffer.subarray` function.\n\n[![build status](https://travis-ci.org/mafintosh/protocol-buffers-encodings.svg?branch=master)](https://travis-ci.org/mafintosh/protocol-buffers-encodings)\n\nMoved into its own module for lighter installs\n\n## Usage\n\n``` js\nvar encodings = require('protocol-buffers-encodings')\nvar buf = Buffer.alloc(4096)\n\nencodings.string('hi', buf, 0)\nconsole.log(encodings.string(buf, 0)) // prints 'hi'\n```\n\n## API\n\nIn general all encoders follow this API\n\n#### `buffer = enc.encode(value, buffer, offset)`\n\nEncode a value. `buffer` should be a buffer big enough to fit the value, `offset` should be the byte offset in the buffer where you want to write it.\nThe buffer is returned for convenience.\n\nAfter a value has been encoded `enc.encode.bytes` contains the amount of bytes used in the buffer.\n\n#### `value = enc.decode(buffer, offset)`\n\nDecode a value. `buffer` should be an encoded value and `offset` should be the byte offset where you want to start decoding.\n\nAfter a value has been decoded `enc.decode.bytes` contains the amount of bytes that was consumed from the buffer.\n\n#### `var len = enc.encodingLength(value)`\n\nUse this method to calculate how much space is needed to encode a value.\n\n#### `enc.type`\n\nA number indicating the protobuf wire type for the encoding\n\n## Encodings\n\nThe following encodings are available\n\n* `encodings.bytes` - encode a buffer\n* `encodings.string` - encode a string\n* `encodings.bool` - encode a boolean\n* `encodings.uint64` - encode a uint64 to varint\n* `encodings.uint32` - encode a uint32 to varint\n* `encodings.sint64` - encode a signed int64 to a signed varint\n* `encodings.sint32` - encode a signed int32 to a signed varint\n* `encodings.int64` - encode a signed int64 to a varint\n* `encodings.int32` - encode a signed int32 to a varint\n* `encodings.fixed32` - encode a uint32 to a fixed 4 byte buffer\n* `encodings.sfixed32` - encode a signed int32 to a fixed 4 byte buffer\n* `encodings.fixed64` - encode a uint64 (represented as a buffer) to a fixed 8 byte buffer\n* `encodings.sfixed64` - encode a signed int64 (represented as a buffer) to a fixed 8 byte buffer\n* `encodings.double` - encode a double\n* `encodings.float` - encode a float\n* `encodings.enum` - encode a numeric enum as a varint\n\n## License\n\nMIT\n","maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"time":{"modified":"2022-08-02T17:56:08.966Z","created":"2018-01-17T13:45:01.251Z","1.0.0":"2018-01-17T13:45:01.251Z","1.1.0":"2018-01-17T13:53:19.184Z","1.1.1":"2020-09-28T14:25:18.439Z","1.2.0":"2022-08-02T17:56:08.903Z"},"homepage":"https://github.com/mafintosh/protocol-buffers-encodings","repository":{"type":"git","url":"git+https://github.com/mafintosh/protocol-buffers-encodings.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"bugs":{"url":"https://github.com/mafintosh/protocol-buffers-encodings/issues"},"license":"MIT","readmeFilename":"README.md"}