{"name":"bint8array","version":"1.1.0","description":"Uint8Array utils for parity with Buffers","main":"index.js","browser":"browser.js","scripts":{"test":"node test.js"},"repository":{"type":"git","url":"git+https://github.com/hyperdivision/bint8array.git"},"author":"","license":"ISC","bugs":{"url":"https://github.com/hyperdivision/bint8array/issues"},"homepage":"https://github.com/hyperdivision/bint8array#readme","gitHead":"568943c8009abe616d77240ad728dea97ad69705","_id":"bint8array@1.1.0","_nodeVersion":"12.18.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-QUrE3Xm1rSu3OQ5PIqwvNUzj/0VEfMsUDKDkUw4kcOOJ5jPpuRzr31MkQSJZi4mwTbW6AGCZGzOrLNyp4jU/jA==","shasum":"5411e1072b8de93d1f39eabe01966e9d97ef2d3d","tarball":"http://registry-npm.ywwl.com/bint8array/download/bint8array-1.1.0.tgz","fileCount":8,"unpackedSize":9195,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvQ3xCRA9TVsSAnZWagAAP98P/iQUYkc47mcZqYp1/7mO\nSUoxptQYUhwQjnEh4RULBwaiESNSZHd1+L/h+i9ALc0vZZAFESrR6FFo7Hcz\n74S2prS7wTQKJC3OsfWP+Xg5eFGERRVAQMO/5E1o3oMTiIvCHJzrSQXsTMGJ\n4THTYM/+nVlEsxaeOanqhXPlgI6lcOwj1pqsc42ZaXLt+8CgpgcbLB4n1fuV\n2hngpnj7eUHwcpxzNjSfl7A3px4/xaplqjGA7NYUWKpVUY2LLLjBXui6ZcRW\nkPTldURRDDA7Bh0uSV3C4v6vrY95Rezqu293UMTs2Jc2AfEqBYu4Cc2uGns9\no7QQYFbssLV7lHz9YkM0z70K/1HK7zyg+aFYCTP0VYORPgAqy8XGLPnJcpew\n8BuW3coVmiZC3UqbvO5KEzlbM1bOa4GLzxJPKviqlakgxoWdkoS5X437xWOI\nWn104fcmiASmIk9cLxPAXJBXe5iQsIj+Vh80P13ljL3j+VOc70pcojJbdEke\nacus65cMhpV17TWhLgdKyo7aTbJvJQvogVr2l0iZUZne4Hca/7dSSgC2om5o\nJgQ+xdehMuOJMjVMOObUDjAp0zUCC7ovZVUSc04Blqmne1mGfY8tQGLScoIf\nUzi+9oZ8hVkhCrx306PPXgvkiXtuvjd0OVR3i6/RvIG3C+sJAr2Bimxi3N/8\nKVDr\r\n=j9xM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH1suYtRsWkXoNFWqt0tWFjTHzrXr1+d2A4UP7ABs340AiEA6dHwRw+D6BsG3pkDUuUkkXGD4qCaqpSlxCYlXleh76s="}],"size":2816,"noattachment":false,"key":"/bint8array/-/bint8array-1.1.0.tgz"},"_npmUser":{"name":"chm-diederichs","email":"christophe.diederichs@googlemail.com"},"directories":{},"maintainers":[{"name":"chm-diederichs","email":"christophe.diederichs@googlemail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bint8array_1.1.0_1606225393352_0.32831722224124826"},"_hasShrinkwrap":false,"readme":"# bint8array\n\nEmulate core Buffer methods for Uint8Arrays\n\n## Usage\n\n```sh\nnpm i -s bint8array\n```\n\n```js\nconst bint = require('bint8array')\n\nconst buf = bint.allocUnsafe(32)\nconst hex = bint.fromString('776f726b7320696e2062726f7773657220746f6f21', 'hex')\nconst b64 = bint.fromString('deadbeef11247', 'hex')\nconst text = bint.toString(hex, 'utf8')\n\nconsole.log(text)\n// works in browser too!\n\nconsole.log(bint.compare(Buffer.alloc(2), Buffer.alloc(2, 1)))\n// -1\n```\n\n## API\n\n#### `bint.toString(buf, [enc])`\n\nDecode bytes to a string according to the given encoding `enc`. Options for `enc` are `ascii`, `utf8`, `utf-8`, `hex` and `base64`.\n\n\n#### `bint.fromString(string, [enc])`\n\nEncode a string to binary according to the given encoding `enc`. Options for `enc` are `ascii`, `utf8`, `utf-8`, `hex` and `base64`.\n\nNote that for `hex` encoding, if the string is not of even length, the last character shall be ignore. This is in keeping with the behaviour of the core `Buffer.from` method.\n\n\n#### `bint.compare(buf1, buf2)`\n\nCompare two Uint8Arrays bytewise. Returns `-1` if buf1 is lesser, `1` if buf2 is greater and `0` if and only if `buf1[i] ==== buf2[i]` for all `len = buf1.byteLength = buf2.byteLength`.\n\n#### `bint.concat(arrrayOfBuffers)`\n\nConcatenate an array of Uint8Arrays into a single Uint8Array.\n\n#### `bint.allocUnsafe(size)`\n\nCreate a new Uint8Array of a given size.\n","publish_time":1606225393476,"_cnpm_publish_time":1606225393476,"dist-tags":{"latest":"1.1.3"}}