{"name":"bint8array","version":"1.1.3","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":"782c18a5936b81fea949852eead2cbe6e81785f8","_id":"bint8array@1.1.3","_nodeVersion":"12.18.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-1RCt3TnM06m4Dolu3BW8WYx7DH/idJrsfuh2/bnFuY9r8YXgEZQ8WMFf/6UnrXa6DjHUJhx/SnZwnM5LV9QdOA==","shasum":"0ad122b5848ce268ffdd010709411f521d9189fc","tarball":"http://registry-npm.ywwl.com/bint8array/download/bint8array-1.1.3.tgz","fileCount":9,"unpackedSize":11045,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFnKRCRA9TVsSAnZWagAAHhUQAJs8KXq+fLqCUuxt7Jif\n6pZc2tDnLkcKD6HxRq6YnwFPUG/2dlavZzEwfGkgJFSJE1I5ge4HWsoYKfzb\ntvTVDergOJXj3JuPCuDDHORoRhqZmGIhuyNurKJZdoUkWzllbmS26BBXfa16\ntwboepcdIVb95UrEJXK4NiwDIVES1ReAAt5BUT01lnKmIZuE0XZff907+kUw\nDiV53JzBp5ptOS/RF3pY0QiaPW9nM3vztEoCuBAml9iUcGTlT5Jy9Q2nevgR\nEksMFN6dg3OTFEgKKj3Vuy/R42INCGY8xBYgxcL3YElnEpvneyb+UE+dzO22\n2/svv4d71UOAXBePmPTSIeN7JokGoKtfByPvC/To+IQBfk1Y9X5Ptbd7OBrK\nIMnTrWt8nTIuV0ZxM5fcAtJyeK6Mw5Y4365178Fy8xneC4CI4pVdKhqZcESo\npSikOgDwlGkJlwfx2lXyd/3mzqSBXET1Ptp/YC6kddhvoBUtMPAms6LCW41Q\nkhUMXF6TJ0/M3C/7f/zXxhNYjs/Xa3C1c4K5G7fw3kd7+YmypfCM79vWW0OU\npNieFFgpsevhvHfbNSCmISbZbCWNCSV7erfzcLnaZYYZ1OSwGOWFps4CAd0L\ntzeAI14Kh59dmPkoOT3G3XQrMLvkEshLc8c+DAzjwN7pLG5/5es5CzqI2ApW\nXih1\r\n=AEV+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCogTDQL+8ltXPCq2wsEkjnJ7cHntNRmtzDunGaBSKllAIgStcl41YFkG4IEtdcfseTA2K2nx8netBcHVXgd0cfSAc="}],"size":3035,"noattachment":false,"key":"/bint8array/-/bint8array-1.1.3.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.3_1628861073235_0.5611321853367033"},"_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":1628861073395,"_cnpm_publish_time":1628861073395,"dist-tags":{"latest":"1.1.3"}}