{"name":"bint8array","version":"1.0.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":"c506570a10434d1f0bf36b5d3f01f8833faceaa5","_id":"bint8array@1.0.0","_nodeVersion":"12.18.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ON+/SEo+xG9P1J6y3feeqHy4BhThna55E6siTlc6Nko7xB8f/3XK4p4o6XoJFgT3QotwelVTuY/tvI8h3uo3xw==","shasum":"9032a1c48817a8a3ee727f686daa676dcb1b9f08","tarball":"http://registry-npm.ywwl.com/bint8array/download/bint8array-1.0.0.tgz","fileCount":9,"unpackedSize":10129,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfu4+/CRA9TVsSAnZWagAAUTAQAJf9oeecuCnjKkiVEZpx\nB6ZU0IvYh7bkPc/M+23fQPN9k1e3RXHQ70a4+BB/gZ0CTAumt9kY/6bfVuJ2\n0uAeiRTYGNUXAR8bh1fz1yGf21YaBRKqR7eMmGGX2ivwfcIfTsPfnjfEJW4j\notJJnS9lW3lAzfh3ExbjVvGwDN1Aumb2oHeb7h6lrZws4hx12EHyjSFP3v9g\nS0KGJQKS+DZ+lKoPuPx5KRy4wZbJ0gXBnVc9ZwpPezWAKz0oBcbxeiFzPgu3\nsuolzxNuSulmVhQK24YeyRRX2JzNNa5NcqAjF7nGpZZxhzzFUxVNgBx5Kke8\nP6jVq7Ch9DtU+eBKnvrtQ3V2US0u6JOlM26U6NMImxRHjJcwncPrbnMuhGM8\nI+tPUjeZWHdIvzmVPdEeM7RzVeGJKW3xYBm2Hu9Os7QyIFhdhLilMi39IgZw\nb5ueN19+L/xl9fr4T4ICQJ4wg5ZEqtJVHOMPzo4U3eCsOUY+K24aaPranRg8\n3nomxX20IGPVgbKrXzQe9ARN0Tv9aGp879T4bEfHZqaAWceu7aZ9Tx2CVmD9\nRt0hvsMd0vbm38/DDVTwJxF0e2yJtaTqtSiVyWZg+/Zx5qCAA10oHi8yA9JM\nCxCf6N+8/muP/MZ8hxm8CA3kkhgxl7ybZSvmDaQaTg0og0gn9bYLFYIFxvDZ\n7HHQ\r\n=QS11\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIChJsWALJpq3TKyE1/xDgv//NAan7r9xq5j5Ats4E3FcAiBJJgiHto7QkoaULw5Hl1w4ZH8LGyJThzaAfV1u4+ONnw=="}],"size":3086,"noattachment":false,"key":"/bint8array/-/bint8array-1.0.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.0.0_1606127551066_0.23486513608675197"},"_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":1606127551188,"_cnpm_publish_time":1606127551188,"dist-tags":{"latest":"1.1.3"}}