{"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":"http://registry-npm.ywwl.com/protocol-buffers-encodings/download/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=="}],"size":3633,"noattachment":false,"key":"/protocol-buffers-encodings/-/protocol-buffers-encodings-1.1.1.tgz"},"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,"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","publish_time":1601303118439,"_cnpm_publish_time":1601303118439,"dist-tags":{"latest":"1.2.0"}}