{"_id":"@aloe2/blake2b","name":"@aloe2/blake2b","dist-tags":{"aloe-bbc82c9c9":"3.0.20228282226","latest":"3.0.20228282226"},"versions":{"3.0.20228282226":{"name":"@aloe2/blake2b","version":"3.0.20228282226","description":"Blake2b (64-bit version) in pure JavaScript","main":"index.js","dependencies":{"@aloe2/blake2b-wasm":"^3.0.20228282226","nanoassert":"^2.0.0"},"publishConfig":{"access":"public"},"devDependencies":{"tape":"^4.6.3"},"scripts":{"unit-test":"tape test.js"},"repository":{"type":"git","url":"git+https://github.com/BitGo/BitGoJS.git","directory":"modules/blake2b"},"keywords":[],"author":{"name":"Emil Bay","email":"github@tixz.dk"},"license":"ISC","bugs":{"url":"https://github.com/emilbayes/blake2b/issues"},"homepage":"https://github.com/emilbayes/blake2b#readme","gitHead":"ff34e1949ea30d3016d4a8e17d459eee4436eda5","_id":"@aloe2/blake2b@3.0.20228282226","_nodeVersion":"14.18.0","_npmVersion":"lerna/5.5.0/node@v14.18.0+x64 (darwin)","dist":{"integrity":"sha512-CnWtHbFIYJPRELYSUezO+tSpIXDGfZl8l/GSv4nQh2eRNd5a0+LXz0vxitMsZZEmiTOfQwjBOgMxRSl6OR6TMQ==","shasum":"079dbee13927a6992aaf03a5a3f9be2b0ad01e21","tarball":"https://registry.npmjs.org/@aloe2/blake2b/-/blake2b-3.0.20228282226.tgz","fileCount":8,"unpackedSize":305353,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCBRA1mmW6A+7YBIlzV6rqOsUNKp8D2djj9zMa6+SLX4gIhANDs8tnKdbuYJd04I4G9BeejoTKLL8jvFDbdvfxRIoC3"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNS5UACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpk/g//Y/IbJf86YURcIJ3niONv8CQN2VPtNGL3e/q3I7Z2oUdNi4XA\r\nl3599iGnbs/+el7E1xxu88R8wM23BxHb4wG9ySuT7WkJRtLL/+zUTnrsNgE+\r\nAdedTJ9+N4S/YRgyl736kX0YzxR2PeVU1w+VqdQ5l82ZuePoiY9EsluDgCqQ\r\nkrjJ2by/7yu/zb0EMdwNCjCP5RRjaQuJoe1dSlsdWPKKIdZKzaCuqaPW0CUK\r\nQGLLGage+XcHZjMYugfINcgMBbiBVTi3O75pWL/cJCQ95y5U4E3/vqVmKmc3\r\nEHGAB0id7ScmM/io7fps4WJOFxDmgsATb9OhTUxF5RRJ/0WD45bq9xuT8qbG\r\nDZpzlSTvX81f1l80o+hWnS7SzV4PN24LT6Skaof6c/W7Hoz3Tls+IfFV52Fo\r\nkTCZwUuM+orQhmUILVc4L51W5eIEpvBXXX+vn3UWJc04t1N7whJtsMn8LaeI\r\nrj1cBR6X6MJFMj6Q2qhMkU4NSjcMrWYJK6vqQj2N350s3d1HJC8wsZcZBf5/\r\nJDK20gfWJqs0SnlzK3Db95JvY79mBv/qV9FJDD1/AjAbJA/BB4t0g5P6WxZ9\r\nIChYNbaxIdmLMg/yDLdXZEfE49FwLN/ZcUcqVJhVh+YZVEss/uA+Owhz61G5\r\nJvGIjFpfpM+V9fqmqfXFk9NN02wUJn1nztw=\r\n=dTe0\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"aaronloe","email":"aaronloe@gmail.com"},"directories":{},"maintainers":[{"name":"aaronloe","email":"aaronloe@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/blake2b_3.0.20228282226_1664429652721_0.7987193495277529"},"_hasShrinkwrap":false}},"time":{"created":"2022-09-29T05:34:12.675Z","3.0.20228282226":"2022-09-29T05:34:12.877Z","modified":"2022-09-29T05:34:13.060Z"},"maintainers":[{"name":"aaronloe","email":"aaronloe@gmail.com"}],"description":"Blake2b (64-bit version) in pure JavaScript","homepage":"https://github.com/emilbayes/blake2b#readme","keywords":[],"repository":{"type":"git","url":"git+https://github.com/BitGo/BitGoJS.git","directory":"modules/blake2b"},"author":{"name":"Emil Bay","email":"github@tixz.dk"},"bugs":{"url":"https://github.com/emilbayes/blake2b/issues"},"license":"ISC","readme":"# `@bitgo/blake2b`\n\n[![Build Status](https://travis-ci.org/emilbayes/blake2b.svg?branch=master)](https://travis-ci.org/emilbayes/blake2b)\n\n> Blake2b (64-bit version) in pure JavaScript\n\nThis module is based on @dcposch\n[implementation of BLAKE2b](https://github.com/dcposch/blakejs), with some changes:\n\n* This module requires you to pass in a `out` buffer, saving an allocation\n* This module allows you to set the `salt` and `personal` parameters\n* This module exports constants for the parameters in libsodium style\n* Uses a WASM version (where it is supported) for massive performance boosts\n\nAll credit goes to @dcposch for doing the hard work of porting the\nimplementation from C to JavaScript.\n\n## Usage\n\n```js\nvar blake2b = require('@bitgo/blake2b')\n\nvar output = new Uint8Array(64)\nvar input = Buffer.from('hello world')\n\nconsole.log('hash:', blake2b(output.length).update(input).digest('hex'))\n```\n\n## API\n\n### `var hash = blake2b(outLength, [key], [salt], [personal], [noAssert = false])`\n\nCreate a new hash instance, optionally with `key`, `salt` and\n`personal`. Bypass input assertions by setting `noAssert` to `true`.\n\nAll parameters must be `Uint8Array`, `Buffer` or another object with a compatible\nAPI. All parameters must also fulfill the following constraints, or an\n`AssertionError` will be thrown (unless `noAssert = true`):\n\n* `outLength` must within the byte ranges defined by the constants below.\n* `key` is optional, but must within the byte ranges defined by the constants\n   below, if given. This value must be kept secret, and can be used to create\n   prefix-MACs.\n* `salt` is optional, but must be exactly `SALTBYTES`, if given. You can use\n  this parameter as a kind of per user id, or local versioning scheme. This\n  value is not required to be secret.\n* `personal` is optional, but must be exactly `PERSONALBYTES`, if given. You can\n  use this parameter as a kind of app id, or global versioning scheme. This\n  value is not required to be secret.\n\n### `var hash = hash.update(input)`\n\nUpdate the hash with new `input`. Calling this method after `.digest` will throw\nan error.\n\n### `var out = hash.digest(out)`\n\nFinalise the the hash and write the digest to `out`. `out` must be exactly equal\nto `outLength` given in the `blake2b` method.\n\nOptionally you can pass `hex` to get the hash as a hex string or no arguments\nto have the hash return a new Uint8Array with the hash.\n\n### Constants\n\n* `blake2b.BYTES_MIN` Minimum length of `out`\n* `blake2b.BYTES_MAX` Maximum length of `out`\n* `blake2b.BYTES` Recommended default length of `out`\n* `blake2b.KEYBYTES_MIN` Minimum length of `key`\n* `blake2b.KEYBYTES_MAX` Maximum length of `key`\n* `blake2b.KEYBYTES` Recommended default length of `key`\n* `blake2b.SALTBYTES` Required length of `salt`\n* `blake2b.PERSONALBYTES` Required length of `personal`\n\n## Install\n\n```sh\nnpm install @bitgo/blake2b\n```\n\n## Test vectors\n\nThis repository includes test vectors with\n`{outlen, out, input, key, salt, personal}` objects for testing conformance\nagainst the spec and other implementations:\n\n* Lines [2 - 257](test-vectors.json#L2-L257) are tests for hashing with no key, taken from [BLAKE2 test vectors](https://github.com/BLAKE2/BLAKE2/blob/5cbb39c9ef8007f0b63723e3aea06cd0887e36ad/testvectors/blake2-kat.json)\n* Lines [258 - 513](test-vectors.json#L258-L513) are tests for hashing with keys, taken from [BLAKE2 test vectors](https://github.com/BLAKE2/BLAKE2/blob/5cbb39c9ef8007f0b63723e3aea06cd0887e36ad/testvectors/blake2-kat.json)\n* Lines [514- 577](test-vectors.json#L514-L577) are tests for hashing with key, salt and personalisation, derived from the [libsodium tests](https://github.com/jedisct1/libsodium/blob/3a9c4c38f7dbe671d91dcfa267c919734b4923df/test/default/generichash3.c)\n\n## License\n\n[ISC](LICENSE)\n","readmeFilename":"README.md"}