{"name":"bint8array","version":"1.0.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":"20f054b0b8943b0356108e25b78b463450d46d81","_id":"bint8array@1.0.1","_nodeVersion":"12.18.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-2PxNZo5aIydLCQWxpZK/GAKhpUflBslvV0vrr1ZV9svT4h4HfloizQPI20Yfr8mpGmvOzJ59Qk8vFoZ4tGvLmA==","shasum":"e72fc9c9968f51a2592bd0f30039396ed2f53a8b","tarball":"http://registry-npm.ywwl.com/bint8array/download/bint8array-1.0.1.tgz","fileCount":8,"unpackedSize":9223,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvOnYCRA9TVsSAnZWagAAaZQP/AneNIVdhtJY6zabUDRo\ntUkCJj4iNrN/WzdF7Ycq8OynC+chq7EEpR3ZIVXMhP1bwS9dqTcMJESWvaMN\nxAOvQXoLftNtswmi2UY7/2B3ItA0cIThfDybYrREBMwXlyvRFblHQJMUNI6J\npk5ddNDJzXl/hzaF3dROOvvhGMIQwYJMPiToVOVg22ht/JyCFZHSeL/rDgdc\nTIXJJJI1bTmTiF6hfr03tKIYZUUpGbbGy1XVRHE66ANxieluUYpVN63poRW5\nhruA0GudEHcE0gkA29YBFBi78OqVx0zghdPd8LpKGCkKEX6cK1C267/tHVtX\n5hWxBSHvLwSDp+n4KhoLgaCS+S12K1ImRcwfwk2wJsO8SjbnqfbPzLCG0/Nr\ntg/nFseY8Q05wP/uQ8VphKqwg37eqP1F2rwDvYsVhSeTx4UcrFWf++afKgpO\n2qpkCw268i4aD71C0XkjKknH+FVXszY2exthHUO6FlYK2GVqaRhmIHJ1nrco\n01XJSBfwCW4+Gio5jwLDj7AElM9IWPQdr/73KEGs+FVW03mLDiarAen/rg2u\nkPW8OlhoVYdGebH+o9eOUafa/pJhbTrv3uSe3ngnO/q1qBeZm/F14cfH4hPv\nm3/PIj4vgIw3LM06ZhWKQlv0iAs1ceFYYKRWWdVT3Jy+vKf3ZrPrvhdvutOx\nY9Pt\r\n=qVBq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCCPj0ZTg50km91hHDGhsLsST3AWV8+Bis+27RCUnhlNwIhAMQFstmRDk2mx2xrgxPXvbeT6CtIKGr1UnV1zNScsf3R"}],"size":2816,"noattachment":false,"key":"/bint8array/-/bint8array-1.0.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.0.1_1606216152474_0.596554158260789"},"_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":1606216152576,"_cnpm_publish_time":1606216152576,"dist-tags":{"latest":"1.1.3"}}