{"_id":"nano-base32","_rev":"5-fd5b9283ae2b1c6e7340ae6bf4348f7b","name":"nano-base32","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"nano-base32","author":{"name":"Gray Olson"},"version":"1.0.0","license":"MIT","repository":{"type":"git","url":"git+https://github.com/temrhn/nano-base32.git"},"main":"index.js","types":"index.d.ts","scripts":{"test":"standard && mocha"},"devDependencies":{"array-buffer-to-hex":"^1.0.0","blakejs":"^1.1.0","hex-to-array-buffer":"^0.1.0","mocha":"^5.0.1","standard":"^8.0.0-beta.5"},"keywords":["base32 encode","base32 encoder","base32","base32hex","nano"],"gitHead":"1bbb2d95dc57766356626368c45ed1d605280f1e","description":"A small, quick, self-contained implementation of the Base32 encoding/decoding scheme used by the cryptocurrency Nano.","bugs":{"url":"https://github.com/temrhn/nano-base32/issues"},"homepage":"https://github.com/temrhn/nano-base32#readme","_id":"nano-base32@1.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"grayolson","email":"gray@grayolson.com"},"dist":{"integrity":"sha512-tIYsNj3Phni+HjJeC5bH4+b8FQQaQAegc/+IrrzjKGyTdMp5hKeNB9tzMYDWG+FQ/r6PRlJE4d0TFrbv/Zs6Ng==","shasum":"eda445dba06aeb18cff786fdb9fa4f6c5f5c6791","tarball":"https://registry.npmjs.org/nano-base32/-/nano-base32-1.0.0.tgz","fileCount":5,"unpackedSize":5817,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAFBu+j9ooHMMg3LRZlYYAANhow1IyRLJ11hIqhoERZdAiEAqhbAGfxh1x7V3CgNe2hTqadLhQNOOm3GEaV71i+Ul6c="}]},"maintainers":[{"name":"grayolson","email":"gray@grayolson.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nano-base32_1.0.0_1519868005760_0.10318383651971774"},"_hasShrinkwrap":false},"1.0.1":{"name":"nano-base32","author":{"name":"Gray Olson"},"version":"1.0.1","license":"MIT","repository":{"type":"git","url":"https://github.com/temrhn/nano-base32.git"},"main":"index.js","types":"index.d.ts","scripts":{"test":"standard && mocha"},"devDependencies":{"array-buffer-to-hex":"^1.0.0","blakejs":"^1.1.0","hex-to-array-buffer":"^0.1.0","mocha":"^5.0.1","standard":"^8.0.0-beta.5"},"keywords":["base32 encode","base32 encoder","base32","base32hex","nano"],"description":"A small, quick, self-contained implementation of the Base32 encoding/decoding scheme used by the cryptocurrency Nano.","licenseText":"MIT License\n\nCopyright (c) 2018 Gray Olson\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"nano-base32@1.0.1","dist":{"shasum":"ba548c879efcfb90da1c4d9e097db4a46c9255ef","tarball":"https://registry.npmjs.org/nano-base32/-/nano-base32-1.0.1.tgz","fileCount":6,"unpackedSize":5845,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa0/FWCRA9TVsSAnZWagAAaKEP/RPK+g7gsx2ECQBEZaA8\neWXy608sgI85Qhk/ybM9l1Y/3CGgK5GPr8+6AEFmWBqSSXR0AMF43WuCYoUs\noCjwR04NyDhFZCou3dHpkA6RnC1riJmCKcKs4nQBpdpYKmiWqQkZoUcPe4ir\n6yj27u/LZWsblPIhUgcaoa3IOsvkQQSabGcE6ReQnH+1WCBn77cTOU7d6IYh\nzR4UHGGYezEoHRfCRfCBne5tQSULrgnQ/ibhn/1aHzMI2ydl2pi8vTyV6NMG\nuYaGgre+agbeCHtW4/wjRqDtnxRiPhLcaqHXdnJIYaita4qEaHh9CfU7fvAn\nwfPaTYs5MjMpsf409K0E6hyp/tCMtHVuBTqqy0KU2kbKEBRgIpDbsJPGDG6o\neKPa9Ndb716sA4/lv8fDh/sde88939fx8jbXgU2oIV1vZDSrMrxgRqoq6VkT\neDeSZDpD7uOWkc3qk/fsIkOL2aCB28q3a+KcVpCy8tTjGZ64i4oZecIMGfIo\nAVGrp4argqWl8kDV0aFlo8VOgG2WuIPFUwaK15ttWJ8xPavfRRAb/PIxBHm7\nJMCb15VfWjtAwXMTkH62NdhRtz9mUtXy1qRzWDnI1E0dTNUGWJQNT5HMaWma\nDQ8pgdX8Ldimy4w+U9Z+nL0eCyXVc0YFWJodiqdIchevE9pn2t6IFGrzoWo4\nwUd+\r\n=f4nw\r\n-----END PGP SIGNATURE-----\r\n","integrity":"sha512-sxEtoTqAPdjWVGv71Q17koMFGsOMSiHsIFEvzOM7cNp8BXB4AnEwmDabm5dorusJf/v1z7QxaZYxUorU9RKaAw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID9CKXdPd0k7A7HlFE6JxBlmTWSLv7J9ZL2/F0OvjVH5AiEAuKUaaas16hoPlNEiJbl2O6kVrPlJJYKsbGlVe00JNYA="}]},"maintainers":[{"name":"grayolson","email":"gray@grayolson.com"}],"_npmUser":{"name":"grayolson","email":"gray@grayolson.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nano-base32_1.0.1_1523839317886_0.10663915734425866"},"_hasShrinkwrap":false}},"time":{"created":"2018-03-01T01:33:25.760Z","1.0.0":"2018-03-01T01:33:25.857Z","modified":"2022-06-20T19:53:36.266Z","1.0.1":"2018-04-16T00:41:58.103Z"},"maintainers":[{"name":"grayolson","email":"gray@grayolson.com"}],"description":"A small, quick, self-contained implementation of the Base32 encoding/decoding scheme used by the cryptocurrency Nano.","keywords":["base32 encode","base32 encoder","base32","base32hex","nano"],"repository":{"type":"git","url":"https://github.com/temrhn/nano-base32.git"},"author":{"name":"Gray Olson"},"license":"MIT","readme":"# Nano-Base32\n\nA small, quick, self-contained implementation of the Base32 encoding/decoding scheme used by the cryptocurrency Nano.\n\n## Installation\n\n```sh\n$ yarn add nano-base32\n```\n\nor\n\n```sh\n$ npm install --save nano-base32\n```\n\n## Usage\n\n```js\nconst nanoBase32 = require('nano-base32')\nconst hexToArrayBuffer = require('hex-to-array-buffer')\nconst arrayBufferToHex = require('array-buffer-to-hex')\nconst blake = require('blakejs')\n\nconst pubKey = '0D7471E5D11FADDCE5315C97B23B464184AFA8C4C396DCF219696B2682D0ADF6'\nconst buffer = new Uint8Array(hexToArrayBuffer(pubKey))\n\nconst encoded = nanoBase32.encode(buffer)\n// => 15dng9kx49xfumkm4q6qpaxneie6oynebiwpums3ktdd6t3f3dhp\n\nconst checksum = blake.blake2b(buffer, null, 5).reverse()\n// => Uint8Array [ 33, 233, 215, 36, 38 ]\nconst checksumEncoded = nanoBase32.encode(checksum)\n// => 69nxgb38\n\nconst address = `xrb_${encoded}${checksumEncoded}`\n// => xrb_15dng9kx49xfumkm4q6qpaxneie6oynebiwpums3ktdd6t3f3dhp69nxgb38\n\nconst decoded = nanoBase32.decode(encoded)\nconst decodedHex = arrayBufferToHex(decoded.buffer).toUpperCase()\n// => 0D7471E5D11FADDCE5315C97B23B464184AFA8C4C396DCF219696B2682D0ADF6\n\nconst decodedChecksum = nanoBase32.decode(checksumEncoded)\n// => Uint8Array [ 33, 233, 215, 36, 38 ]\n```\n\n## API\n\n```javascript\n/**\n * Decodes a Nano-implementation Base32 encoded string into a Uint8Array\n * @param {string} input A Nano-Base32 encoded string\n * @returns {Uint8Array}\n */\n function decode (input)\n\n/**\n * Encode provided Uint8Array using the Nano-specific Base-32 implementeation.\n * @param {Uint8Array} view Input buffer formatted as a Uint8Array\n * @returns {string}\n */\nfunction encode (view)\n ```\n\n ## Running Tests\n ```\n $ git clone https://github.com/termhn/node-base32\n $ cd node-base32\n $ yarn install\n $ yarn test\n ```\n\n## Credit\nEncoding and decoding algorithms based on:\n- [base32-encode](https://github.com/LinusU/base32-encode) - Base32 encoder\n- [base32-decode](https://github.com/LinusU/base32-decode) - Base32 decoder\n","readmeFilename":"readme.md"}