{"_id":"big-varint","_rev":"7-257233740fb6069e9c35323c414e7f1a","name":"big-varint","dist-tags":{"latest":"0.2.1"},"versions":{"0.1.0":{"name":"big-varint","version":"0.1.0","keywords":["bigint","varint","signed-varint"],"author":{"name":"Joel Gustafson"},"license":"MIT","_id":"big-varint@0.1.0","maintainers":[{"name":"joelg","email":"joelg@mit.edu"}],"homepage":"https://github.com/joeltg/big-varint#readme","bugs":{"url":"https://github.com/joeltg/big-varint/issues"},"dist":{"shasum":"3a7b3f56321d578a57c4179d5356059bf01a133d","tarball":"https://registry.npmjs.org/big-varint/-/big-varint-0.1.0.tgz","fileCount":21,"integrity":"sha512-KPAZyR7E5e41cAAiqaU73KI9mgIHlU0hh2izwC8RxshblOATX4CtXy9Cd5ut5CO2qM77Ophv4PLZIyOL+7SzPg==","signatures":[{"sig":"MEYCIQCxL4GyOwHDClQoHO4QfGfMXR8ftrO23JwfZb5VMbJyvQIhAJwuvdrOpa1DPgRP3l8YlH14t0WMpF5BUhHZvJq85gHY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":5039,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg6KqBCRA9TVsSAnZWagAAQ/kQAIG1kR+WI+EjJCdrRJNF\nSlkdcdjlVX8aKTwNv1o7/JlZFctPJv6nBICUCexXJLJ9YjM89Wn8A4svaSKJ\ndc8MZgYegPUa80dgor6GXRKH/QTlGgdISVM3joUKvuY4t1yRTmKmK8QqmmWr\nsr5FSG99W/RbtqjqzKggjGIznnL5kwgHpk8rZpgltteq9twZhHP1Vh5VIoAP\naw0OYsCK8ONm7ceOWs5rjLl9n5jSk4VB/f5VfgJs+LTsdlzcKtMjpdHVkh8/\nDJ4q9qEsggaXr60xatKSwKkiVyp6TfcVhmWqJ9auWhxOkPdDdoe+YJn1I0SO\nqFIdMfyE2I0sMJwvaGwsJZDzYpxOGyeyt5eWf2yhvakrIEveFu+KLDjrs/cV\ndF/V6PVGTvtIlxn1a0dlE6zmYo/tym9bMYxiv1X7iY+5lE7pfNLDSoWgdyHL\n3QBzAM6TEWizGrpa3+/SvqJp9O7tAuLRVOLrrM+siWYpc8JkVXLo0lY2IvWL\nyC5ghzko30JHgbi2v8akvVJwGeJoEnj80i4GZ//B7zLDUK6Q7RSq39XveRFW\nFmnwpHBpYJ77E7V2LtVkLpfeiWTIBDtgqI1O/BAX7UljO6MEJ8kqq07KXAbG\n5UT1HHHylrH2/02dQeQVLp/QPTkjt77k0YUHUeahrLkXjTYsfzOwNHSGlAnq\nq/++\r\n=LRNu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","type":"module","types":"lib/index.d.ts","gitHead":"159aa277639efe6b26a82dccf5a36b431b18688b","scripts":{"test":"ava","build":"tsc"},"_npmUser":{"name":"joelg","email":"joelg@mit.edu"},"repository":{"url":"git+https://github.com/joeltg/big-varint.git","type":"git"},"_npmVersion":"7.17.0","description":"Encode and decode signed and unsigned BigInts","directories":{},"_nodeVersion":"16.3.0","_hasShrinkwrap":false,"devDependencies":{"ava":"^4.0.0-alpha.2","ts-node":"^10.0.0","typescript":"^4.3.4"},"_npmOperationalInternal":{"tmp":"tmp/big-varint_0.1.0_1625860737356_0.30895828790377955","host":"s3://npm-registry-packages"}},"0.1.1":{"name":"big-varint","version":"0.1.1","keywords":["bigint","varint","signed-varint"],"author":{"name":"Joel Gustafson"},"license":"MIT","_id":"big-varint@0.1.1","maintainers":[{"name":"joelg","email":"joelg@mit.edu"}],"homepage":"https://github.com/joeltg/big-varint#readme","bugs":{"url":"https://github.com/joeltg/big-varint/issues"},"dist":{"shasum":"73c0acf8ea9639cda464b9a0be7d1f4995c7bca3","tarball":"https://registry.npmjs.org/big-varint/-/big-varint-0.1.1.tgz","fileCount":21,"integrity":"sha512-bNRO9fwiaorK2i9hqX7PwzZt9DH/FsIjudFPFAQ4eB8+LEYQ9G6XOyvREzMX6wdCd9GtHmysgxPgpo+muHA0Qg==","signatures":[{"sig":"MEYCIQCh7woat+DietYkq08ppPur92zjYRH2AOKHwID2O3mW7AIhAOYKWH3R1IFwAqRNv+G5PGjcwnkZV55mwWOjY/YHZ96/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8702,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJ7aVCRA9TVsSAnZWagAAE2gP/jXPquuIFds+hJBKIGEw\n6NMaBxpz47iTTtet+b+gOlnTBXNaqd2FyV/qdVPmk1N7wPQ2rTBN7skowsz9\nIeZYGP5c1g5kZWBSnMEDs+S5ii6fhuWI9WK93DDg1+tXboi1zbIvSGRJa+6A\nvIEg/z6O64FANTPZbLiEjhrO/mS+TWMmeOLOn7uQFTV46lyesXEDC9z0kt/B\nGdBraTRMjssMEzVaOpraCFKNOp5bzXUwymQavxtqxpNUytZFtqvxhLMaZazN\ngxcfW17H/qJuAo2uKY9jQPP3lPK4N9+PQpPn+b3+q26i9Gcn9oCvJ5jEEofZ\nmio90lO8uUu9NXIBkftQjex6uXf3K1XqwqaK+Nw87TXwXpU7cfhXJye5FKvb\n0Z2us+7FlaTqBUXZQLX08/QJvOy955JJY6zHwLM/q4IitH9mqPLOGIwhB+7W\nQCXyQ5Jl+8gMvQwZPm/rB1oxsXxcQgLgvo+RtqvUoFGy2/AUvWF2E/Z3nA6h\nLL+S4hMYHn7jc0GY4+FGsquFDhxz13YotCqqKsIlkVXoGvRFkWpuvo0kE78J\nHJTQZ0vbMpsUq3wVO0+w2wabXEff8/tDabvsWF5HBW5wzzAARJdKfweKd8cE\nueFp7Y/MojzbR6X5V0BsQuMcdSYLmmPfxw6P1C0eFWK9Aguwed6BFQVbKYZN\nssWg\r\n=Bm4G\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","type":"module","types":"lib/index.d.ts","gitHead":"36cf90c4a83b6ee395341a32f1cccb8e92d601bb","scripts":{"test":"ava","build":"tsc"},"_npmUser":{"name":"joelg","email":"joelg@mit.edu"},"repository":{"url":"git+https://github.com/joeltg/big-varint.git","type":"git"},"_npmVersion":"7.20.3","description":"Encode and decode arbitrarily large signed and unsigned BigInts","directories":{},"_nodeVersion":"14.17.4","_hasShrinkwrap":false,"devDependencies":{"ava":"^4.0.0-alpha.2","ts-node":"^10.0.0","typescript":"^4.3.4"},"_npmOperationalInternal":{"tmp":"tmp/big-varint_0.1.1_1629992597888_0.11910045342568232","host":"s3://npm-registry-packages"}},"0.1.2":{"name":"big-varint","version":"0.1.2","keywords":["bigint","varint","signed-varint"],"author":{"name":"Joel Gustafson"},"license":"MIT","_id":"big-varint@0.1.2","maintainers":[{"name":"joelg","email":"joelg@mit.edu"}],"homepage":"https://github.com/joeltg/big-varint#readme","bugs":{"url":"https://github.com/joeltg/big-varint/issues"},"dist":{"shasum":"5c75c866f244f49151e95f92bbc0487ec4d42b70","tarball":"https://registry.npmjs.org/big-varint/-/big-varint-0.1.2.tgz","fileCount":9,"integrity":"sha512-LXlryZdieVlzxISysI8fua3d5cSNEeYBY9fdqjAVQkJlkv8UPcETZrWEITE4MtalWRsfpPaax86CdqCg+l77ZQ==","signatures":[{"sig":"MEUCIAtUTeM7vRGj0Xk3c/BEzmMG0gMc86fZwgHZYt5+qk+0AiEA5Ale+mSZOO1oXEKO/5ys86mMikZ2aEQHAhELHq6OksM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7879,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhL98eCRA9TVsSAnZWagAAdzQP/0KaQz5YXDLoyCWtCcRK\nZHm6tIV2TlhdBia5DTgUiWfTHPxJhj0/5c1c7x0zkrj4CjB5TkJmavyjVQhz\nZSqQXnKtbtkz4cZgSJ2M1RPgz6Yrv6J1JzkzpsjxcgTeA2CPaJJPXc3PADxG\n5svpWxLjsnMnkDk3OGJHsCDlMD6py4X4d+7p2VT8JURudWAK6TiEdlrNAtao\nZblys7KQP8kp6XtqHKJXPJWPoxm81Ha0yqclSTt1/0RV31s2AHcZvcJbzWzN\n9U0Z6IKhtVjRPUT0EZBMgZ+XPrbne0L6lFK/MCxuoWYCrUfWrQGu1TljzOrc\nwgVEAgPvDMgFfI13rTIetuu+u2Rwj7nnEMqrOdmTXY1fCdxEDAqvgYdSlKw/\nY9kTRrLufWpTDfAR2XswK24x6smfTvytXGQJ1KyFQzSE4o9lG3QYmJkpuMxi\n3BtXPwFonJ9HPltrS9d8mK17tYfOYgR3V+YYKBEjOzZmvZwlpBTJRDK95XT3\nPvY+NqMtok/qWYGN4hVgqK/1BDGmkbar5u3LzbiIcgLADpZVWCyMJahzqy2q\nTtcW7avOQVAXyaPgecgBl1WVoTLI/VoLQZFEs61d8Z5NLpVy9UEjuf92d5sq\nm+qLHCZwlqPchxyIKIT+gng2rujoFY7IzL2qMvSeE4uVxR0Ap035fpEnhpK0\nxS/i\r\n=67QW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","type":"module","types":"lib/index.d.ts","gitHead":"93d2c543e6b25006662bac55553441c57885c73d","scripts":{"test":"ava","build":"tsc"},"_npmUser":{"name":"joelg","email":"joelg@mit.edu"},"repository":{"url":"git+https://github.com/joeltg/big-varint.git","type":"git"},"_npmVersion":"7.21.1","description":"Encode and decode arbitrarily large signed and unsigned BigInts","directories":{},"_nodeVersion":"14.17.4","_hasShrinkwrap":false,"devDependencies":{"ava":"^4.0.0-alpha.2","ts-node":"^10.0.0","typescript":"^4.3.4"},"_npmOperationalInternal":{"tmp":"tmp/big-varint_0.1.2_1630527262498_0.5362307400827202","host":"s3://npm-registry-packages"}},"0.1.3":{"name":"big-varint","version":"0.1.3","keywords":["bigint","varint","signed-varint"],"author":{"name":"Joel Gustafson"},"license":"MIT","_id":"big-varint@0.1.3","maintainers":[{"name":"joelg","email":"joelg@mit.edu"}],"homepage":"https://github.com/joeltg/big-varint#readme","bugs":{"url":"https://github.com/joeltg/big-varint/issues"},"dist":{"shasum":"e6ba78d2ad131a53ee6a0ae2a0db1d6fc55d21e5","tarball":"https://registry.npmjs.org/big-varint/-/big-varint-0.1.3.tgz","fileCount":9,"integrity":"sha512-HgJQG8DtWAaYtrXTCasQukrMO0jbtQpd4BPEjr+JHoLRrbyIr8IxrMp01OZVJCoZBdqGynGHvp2iz0mabXz6dA==","signatures":[{"sig":"MEYCIQDLPEULpsBe7RSat7kRq+wP7NuW84z8om69CZLov+H+vgIhAI702maC/7vV9e1JI7qitAwIMO5hg+a54oqv6eEBCNKE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7539,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2kt5CRA9TVsSAnZWagAAlo0QAI4F+LiTZ/imfYIKgrHN\nSQwX2EjKL4K9eY7j/XWoBmJGXLB7T3rrSTVasKXWOHqVCPAmiSrhqWMZvHHx\nS7jHWiaGSO2B/k8JMzgxKSMywsYwhnu54AfBmCmS1kvKyRGv/b9ezp1WgpE1\nH389XPjkVoVDdoxCyQfxMeLg83HsaV+qHqfXrckiqCDsDA6ZBPN/VnWglfQt\nVONLjYVt/Ts+vTR8M0EGgMq4hpuw0YmrI8uwpb5tXni7vobeW6/A8ygMP5kG\nyNxrG+l8qvkdCCKnb5JDtGgXRXT080w7kHkchirDcHR3Nkl+hS9mJpWxniLK\n0W1orafIMLzG7tUEnUSG7SeXBqS3SkPwqgvTcq8nLoVx1gTpz3vIXCR3YdX6\nmMwjibwNnb5SohZLNgFtI7wir05gPRum6W5Imm2NcF5JN8uusCzl76Vuqm9w\nUf5bFZ7i4fTWesa7wF42zirZ0MbcZb/F2HLdhrLZPFW74P4euiTtrmwi+wQb\ns+XRLzUeEGZhQKi7puz+/as6zc48GUZ2+grKSlMUjxU9mQ6w9sRrQn9bpr19\nDHEqPAU2zYgxIVRfzNN6H+VFtJBFZqmIqgH0ARbR0tc2pq499LumbTeqFLKR\n45Wi+BKVJPjvzUHhUmoSOU9m5ZUrMtx70zY4oYpopuh3MpCD0Jr4murV5QRl\nL4kN\r\n=MRyH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","type":"module","types":"lib/index.d.ts","gitHead":"5c17a49510d3e3e0212c915c883c36a0f1ed8d7d","scripts":{"test":"ava","build":"tsc"},"_npmUser":{"name":"joelg","email":"joelg@mit.edu"},"repository":{"url":"git+https://github.com/joeltg/big-varint.git","type":"git"},"_npmVersion":"8.1.1","description":"Encode and decode arbitrarily large signed and unsigned BigInts","directories":{},"_nodeVersion":"16.9.0","_hasShrinkwrap":false,"devDependencies":{"ava":"^4.0.0-rc.1","typescript":"^4.3.4"},"_npmOperationalInternal":{"tmp":"tmp/big-varint_0.1.3_1636334973885_0.6832753697195186","host":"s3://npm-registry-packages"}},"0.2.0":{"name":"big-varint","version":"0.2.0","keywords":["bigint","varint","signed-varint"],"author":{"name":"Joel Gustafson"},"license":"MIT","_id":"big-varint@0.2.0","maintainers":[{"name":"joelg","email":"joelg@mit.edu"}],"homepage":"https://github.com/joeltg/big-varint#readme","bugs":{"url":"https://github.com/joeltg/big-varint/issues"},"dist":{"shasum":"f2478be4770517bee13a52b26340ebfb86aa36ed","tarball":"https://registry.npmjs.org/big-varint/-/big-varint-0.2.0.tgz","fileCount":9,"integrity":"sha512-O9lHOxmiVVtFxxbMctGW2/ewRG610wOHx1seOtzyrQE/qiu7gvG9CdenYNT7CGdIxhIn6WLUy4wjsdk38aIdoQ==","signatures":[{"sig":"MEYCIQCY8weUfw+8oATd2SyemDoQj6KamekSY3aoFVF9y9ggqwIhALuJu+O9OaC3sQVgVhCeDJztMXBPEyQPPOVJtrSJPH5n","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8272},"main":"lib/index.js","type":"module","types":"lib/index.d.ts","exports":{".":"./lib/index.js","./signed":"./lib/signed.js","./unsigned":"./lib/unsigned.js"},"gitHead":"20a230d0ca16a0163fe6a07465640a5fde0723bf","scripts":{"dev":"tsc --build tsconfig.json test/tsconfig.json --watch","test":"ava","build":"tsc --build tsconfig.json test/tsconfig.json","clean":"tsc --build tsconfig.json test/tsconfig.json --clean"},"_npmUser":{"name":"joelg","email":"joelg@mit.edu"},"repository":{"url":"git+https://github.com/joeltg/big-varint.git","type":"git"},"_npmVersion":"10.8.3","description":"Encode and decode arbitrarily large signed and unsigned BigInts","directories":{},"_nodeVersion":"22.9.0","_hasShrinkwrap":false,"devDependencies":{"ava":"^6.1.3","typescript":"^5.6.3","@types/node":"^22.7.6","@ava/typescript":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/big-varint_0.2.0_1729180449389_0.5616317821667121","host":"s3://npm-registry-packages"}},"0.2.1":{"name":"big-varint","version":"0.2.1","description":"Encode and decode arbitrarily large signed and unsigned BigInts","type":"module","main":"lib/index.js","types":"lib/index.d.ts","exports":{".":"./lib/index.js","./signed":"./lib/signed.js","./unsigned":"./lib/unsigned.js"},"scripts":{"build":"tsc --build tsconfig.json test/tsconfig.json","dev":"tsc --build tsconfig.json test/tsconfig.json --watch","clean":"tsc --build tsconfig.json test/tsconfig.json --clean","test":"ava"},"repository":{"type":"git","url":"git+https://github.com/joeltg/big-varint.git"},"keywords":["bigint","varint","signed-varint"],"author":{"name":"Joel Gustafson"},"license":"MIT","bugs":{"url":"https://github.com/joeltg/big-varint/issues"},"homepage":"https://github.com/joeltg/big-varint#readme","devDependencies":{"@ava/typescript":"^5.0.0","@types/node":"^22.7.6","ava":"^6.1.3","typescript":"^5.6.3"},"_id":"big-varint@0.2.1","gitHead":"5602634adcb73adbc03d2374026b4b0ae72aa7b8","_nodeVersion":"22.9.0","_npmVersion":"10.8.3","dist":{"integrity":"sha512-5C/QY64XTTr+IncQ6fr5mH1+QuxZZUIjIgjZPnteLfOHeaHKTuLoajgVRgiL+XThCr339SFX+qjeVDfvaySeqw==","shasum":"bc9ecc10c23cfd7151cfc7475bb8ca4ec25e6f32","tarball":"https://registry.npmjs.org/big-varint/-/big-varint-0.2.1.tgz","fileCount":9,"unpackedSize":8284,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBy7JHzVaj5asIq8c4ovT0PaVeenQNMAY9SgXOQtVym8AiEAwQ92gyPUutCYo6qoVhr9hVKzZL7yXKiHyd9SHuDcDi4="}]},"_npmUser":{"name":"joelg","email":"joelg@mit.edu"},"directories":{},"maintainers":[{"name":"joelg","email":"joelg@mit.edu"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/big-varint_0.2.1_1729191945432_0.18412495896975822"},"_hasShrinkwrap":false}},"time":{"created":"2021-07-09T19:58:57.356Z","modified":"2024-10-17T19:05:45.805Z","0.1.0":"2021-07-09T19:58:57.466Z","0.1.1":"2021-08-26T15:43:17.974Z","0.1.2":"2021-09-01T20:14:22.647Z","0.1.3":"2021-11-08T01:29:34.040Z","0.2.0":"2024-10-17T15:54:09.598Z","0.2.1":"2024-10-17T19:05:45.639Z"},"bugs":{"url":"https://github.com/joeltg/big-varint/issues"},"author":{"name":"Joel Gustafson"},"license":"MIT","homepage":"https://github.com/joeltg/big-varint#readme","keywords":["bigint","varint","signed-varint"],"repository":{"type":"git","url":"git+https://github.com/joeltg/big-varint.git"},"description":"Encode and decode arbitrarily large signed and unsigned BigInts","maintainers":[{"name":"joelg","email":"joelg@mit.edu"}],"readme":"# big-varint\n\n[![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg)](https://github.com/RichardLitt/standard-readme) [![license](https://img.shields.io/github/license/joeltg/big-varint)](https://opensource.org/licenses/MIT) [![NPM version](https://img.shields.io/npm/v/big-varint)](https://www.npmjs.com/package/big-varint) ![TypeScript types](https://img.shields.io/npm/types/big-varint)\n\nEncode and decode arbitrarily large signed and unsigned BigInts.\n\nThis library is TypeScript-native, ESM-only, and has zero dependencies. It uses Uint8Arrays and works in the browser, Node, and [Deno](https://deno.land/). It uses the same binary encoding as Go's [encoding/binary](https://pkg.go.dev/encoding/binary) module, the [Protobuf spec](https://developers.google.com/protocol-buffers/docs/encoding), and the [varint](https://www.npmjs.com/package/varint) / [signed-varint](https://www.npmjs.com/package/signed-varint) NPM packages.\n\n## Table of Contents\n\n- [Install](#install)\n- [Usage](#usage)\n- [Testing](#testing)\n- [Credits](#credits)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Install\n\n```\nnpm i big-varint\n```\n\n## Usage\n\n### Encode a Signed Varint\n\n```ts\nimport { encode } from \"big-varint/signed\"\n\nconst i = -300n\n\nencode(i) // Uint8Array(2) [ 215, 4 ]\n```\n\n### Decode a Signed Varint\n\n```ts\nimport { decode } from \"big-varint/signed\"\n\nconst data = new Uint8Array([215, 4])\n\ndecode(data) // -300n\n```\n\n`decode` can also be passed an optional `offset` parameter:\n\n```ts\nimport { decode } from \"big-varint/signed\"\n\nconst data = new Uint8Array([0, 0, 215, 4, 37, 37, 37])\n\ndecode(data, 2) // -300n\n\n// The encoding length of the most recently decoded value\n// can be accessed via the `decode.bytes` property.\ndecode.bytes // 2\n```\n\n### Get the Encoding Length of a Signed Varint\n\n```ts\nimport { encodingLength } from \"big-varint/signed\"\n\nconst i = -300n\n\nencodingLength(i) // 2\n```\n\n### Encode an Unsigned Varint\n\n```ts\nimport encode from \"big-varint/unsigned\"\n\nconst i = 123456789012345678901234567890n\n\nencode(i)\n\n/*\nUint8Array(14) [\n  210, 149, 252, 241,\n  228, 157, 248, 185,\n  195, 237, 191, 200,\n  238,  49\n]\n*/\n```\n\n### Decode an Unsigned Varint\n\n```ts\nimport { decode } from \"big-varint/unsigned\"\n\nconst data = new Uint8Array([210, 149, 252, 241, 228, 157, 248, 185, 195, 237, 191, 200, 238, 49])\n\ndecode(data) // 123456789012345678901234567890n\n```\n\n`decode` can also be passed an optional `offset` parameter:\n\n```typescript\nimport { decode } from \"big-varint/unsigned\"\n\nconst data = new Uint8Array([\n\t0, 0, 0, 0, 210, 149, 252, 241, 228, 157, 248, 185, 195, 237, 191, 200, 238, 49, 37, 37, 0, 0,\n])\n\ndecode(data, 4) // 123456789012345678901234567890n\n\n// The encoding length of the most recently decoded value\n// can be accessed via the `decode.bytes` property.\ndecode.bytes // 14\n```\n\n### Get the Encoding Length of an Unsigned Varint\n\n```typescript\nimport { encodingLength } from \"big-varint/unsigned\"\n\nconst i = 123456789012345678901234567890n\n\nencodingLength(i) // 14\n```\n\n## Testing\n\nTests use [AVA](https://github.com/avajs/ava) and live in the [test](./test/) directory.\n\n```\nnpm run test\n```\n\n## Credits\n\nA previous version of this library was adapted from [chrisdickinson/varint](https://github.com/chrisdickinson/varint), but has since been rewritten from scratch.\n\n## Contributing\n\nI don't expect to add any additional functionality to this library, but am potentially open to proposals for better interfaces. Open issues to discuss any questions before making an PRs.\n\n## License\n\nMIT © 2021 Joel Gustafson\n","readmeFilename":"README.md"}