{"name":"bint8array","version":"1.0.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","gitHead":"cdad3789c27df5af9d854918c92ee6bec948588e","_id":"bint8array@1.0.2","_nodeVersion":"12.18.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-/EwzH5D9pVO7yTetxHJlQE+3sa6B/IX5HSPCVOEO/274v3kOnGggsaw+QaslGq/SFY+l0QxM/8ILyXJ92NdugA==","shasum":"6f71b10eaea64f2261458f657eff5725f3d722e7","tarball":"http://registry-npm.ywwl.com/bint8array/download/bint8array-1.0.2.tgz","fileCount":8,"unpackedSize":9219,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvPqTCRA9TVsSAnZWagAAPywQAIfK/vMceBn4haIUBa5e\nyjhUPGplF3/l2/Ta8KnAfNY4HEx3rm7SISfIxMw6/z3AMbp+7yB4EocyxCwH\nFKHq7O8CruQrSYhDzPnCFKjHi79WjG96jynboKm6iPd9gmtjiSLEDAiPRgwE\npWw+RSLQ6LK3rz05C1BR0Y9oaovF++tlVtYiqVyZFQq+WI1ldz/DzufkE3bc\nDFwlSnVbgaHNMRl0C9XpFi9GZSdUP5Pc30HFYgUVyO3oPEncV/Riw74WfgVY\nzap5sKFT1Vw/flz0YML3E+kXdaH+W3eeA6hhZnFg55NdFTj19+N3SnchWV+j\ny4e7YWT2V1TgFeqEaql1emj04oqiRWAzTJ8rNnJVzXFzPgEJzw2VUebSOJjQ\nzx2aYll7PDABSA0U8iQrkkIEfiqlj+U/VXCkgDDvzeQJFd4C1Ng6AXaTf8iD\nL5mjl3GVWa3BLNU9gYMeH0VbL9Tsqt1347BeZDezYGYx4YstWJwe1IPaYnLy\nhSBrD2gZrHtrPgGal//0YI64JZ3vmS+cbQrGgkiVM514xK+oWT2xVqFNY0Eq\nfKsol5Qj1UKhu3AZsJQgQCCzRNujXhq5KFtW/t3U35JXgLX+1acDh6iAIM11\n2OPUU97uOG1LxJCaHsp6tPIAR2Kpv9/W7QHoXXq7kn7omNbFivnsA2UgHrDV\nEeo5\r\n=2pY1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBaeHzDGek/5fKl61quC2dLaaO3KnUqLqmdUfCPKtpvFAiEAxuCRkj6tFPpFA1yQSQOrg9Yqy0aLwGncGo/ptRuptQM="}],"size":2801,"noattachment":false,"key":"/bint8array/-/bint8array-1.0.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.0.2_1606220435037_0.3944827788226457"},"_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":1606220435163,"_cnpm_publish_time":1606220435163,"dist-tags":{"latest":"1.1.3"}}