{"name":"bint8array","version":"1.1.2","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","devDependencies":{"tape":"^5.1.1"},"gitHead":"88ae69ebe2b154549bb121e0b7eb55bc0fdd5963","_id":"bint8array@1.1.2","_nodeVersion":"12.18.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-w88GqsD0VUtYQrc/YGCjY5UnTz57MXBvED4cQyz84P2gpbtP3lZoiz1xl6xEDU9TNrgBZSX3VfkdUlEdByOIag==","shasum":"68b263caa6988aa85c6ac878926a2234583a570a","tarball":"http://registry-npm.ywwl.com/bint8array/download/bint8array-1.1.2.tgz","fileCount":9,"unpackedSize":10257,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgUOQTCRA9TVsSAnZWagAAi54P/20ZYSl1kXNFebhNzzNl\nQWfd6Fi+xYrFZtEqQJgiwg7QIfwXU2yAMi85VvLZUolclum0CZEouwvoWvK9\ntE6DFD4Q7EtVikB3eKXStuChz0Ap5Q1VzOsklcPPTvYhZT7XuXdMLHm3rD0h\nZvNQUsal/E9xt6vnyAhe9t6wyjv/Znwa8Yu22TkTYMrcFpel8ExyhowcMnmN\nzlwO3qKxiilxTx6Do/JgVy8ilJ16mkcEcxqix1DpdfVgvYKPR8cQOZvEtL3S\nTgHSaBa6HZ4ma6u6SVVWT3+wNOdfHexITXJvAptoOd3tib9jgfh0nQqgXkY0\nehCbxQA5pS2VfFqZz0Q9sAkME537D18XWnmA1MVyE9wf9cPn9gJOLrDArpJZ\noSGlZCqE/ypswDfoqWb4rXmSsapYxGdOiEYmrE2RkXOx32FEMUzKGWo7u4tx\npr28KUfnEEqGAe/pS2L19zv0PbbWI4QgVvw7CDj6XUjBhMFuIRYF1C2oH40G\ntOf2h0qBJQynqMWJq04SXg4Hww3AJTZ34OSlf2V7BVBAcFMfQtxjkhQgUmQb\n8IxnF93L7hN0q32QK0oD+c1L2hfKM0z+W5+0ZBHOpOzfpo98LZauQ0gEOgXE\nFJJKXoMA/fLBOeEATZHsU9NjnmMXBV/E1p8V9ylH/50bq74rX+nKF8cpqDXg\n+Jcn\r\n=2eCL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4/PCUboTz9ftXnQLyT7oN409MnHcILKpCh1a1T4WMiQIgXBGX+tKOdTfsOYESJITLTMOfp0XIZoWfikhgHjzwCxM="}],"size":2917,"noattachment":false,"key":"/bint8array/-/bint8array-1.1.2.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.2_1615914003006_0.9923288986137291"},"_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":1615914003216,"_cnpm_publish_time":1615914003216,"dist-tags":{"latest":"1.1.3"}}