{"name":"bint8array","version":"1.1.1","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":"7e215a32d669097c616b664d99a74b4881123e69","_id":"bint8array@1.1.1","_nodeVersion":"12.18.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-MFgYYhEU92shS6rCCpXQ802uMqZb3lQnVPFsjg2QnrDIuwYPC2IwIhK9PpXh12mZv1tT0sPG4efQBHmTOL/iHQ==","shasum":"5eccb3518727484c36446db806b62a840db02e37","tarball":"http://registry-npm.ywwl.com/bint8array/download/bint8array-1.1.1.tgz","fileCount":8,"unpackedSize":9232,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2jQBCRA9TVsSAnZWagAAKKoP/AutBbwvp1HE/0i9ZKa9\nc0PTK+sCdTNyzCUJUavxY770kuTDeHFMKejdYxf1WaZs/7Y1W+NK/DwbspNi\n+gUL5sYka0+7yWAjBGEpoici6GfYoJZDC9hTgwe/XHH0o2BNu27CD/2vpvCM\nraCJKLRbCuSyDxlioleMtFi8G2g72ofP52oNQp5mkBqgIXHWyCmDS9GwpC98\n45pLRX9cEAblAAYAkUfg2maaGspGuc+wQoLmPGZ3xRjqJrDiu4dHQIAA7iHZ\nzy2Usv/UpAqt+mEx670g9xM3opQ4LH5o5v4cV3fQGvQICEybYkq0yU9Ns3/e\n6BwNGrh0dR3mekUOD4fLqimN21KHs6Ez7oQwRb00i1O7UgjJMtBTiRJEk0ty\nAigb0bnGFEMwnRHDemfLklgM4Ez1WDSVDD3RJiJgzv5oFB2F5Ws6iysXnJ3q\nXlXOkstFLBZNg/QE/fLEKtF69tEYwzckQ/WJe8MAVsn+ABI+JsaJPD4x1C1d\ntwcazRZrKrOGlgxtMEbIyeGX1tVqRnZlBEW6kY1BFPsoehseAGHrH5EHY9bj\n/aMshru5F+jobgw608wJdSY5IJw1/1ebmCpDE27yHIchm0CJd1m4SVO4eGgL\nT6IPh1z5DHYkoyaJsqI+Nr2rE0J5YpjwLedRl9G05liRW1kKRUPAYt3h/WXg\nf3ux\r\n=W0Hu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCqYj4BfQnj1mkyOnmwGCkvfzo42hFSvFP0LLwf+lLMawIhAIIAMbZRL2fSSZSeylvj1F9wsEfd+L58+oPlKJuOOLJD"}],"size":2821,"noattachment":false,"key":"/bint8array/-/bint8array-1.1.1.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.1_1608135681221_0.23424048018036991"},"_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":1608135681333,"_cnpm_publish_time":1608135681333,"dist-tags":{"latest":"1.1.3"}}