{"name":"base-x","version":"3.0.7","description":"Fast base encoding / decoding of any given alphabet","keywords":["base-x","base58","base62","base64","crypto","crytography","decode","decoding","encode","encoding"],"homepage":"https://github.com/cryptocoinjs/base-x","bugs":{"url":"https://github.com/cryptocoinjs/base-x/issues"},"license":"MIT","author":{"name":"Daniel Cousens"},"main":"src/index.js","types":"src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/cryptocoinjs/base-x.git"},"scripts":{"build":"tsc -p ./tsconfig.json ; standard --fix","gitdiff":"npm run build && git diff --exit-code","prepublish":"npm run gitdiff","standard":"standard","test":"npm run unit && npm run standard","unit":"tape test/*.js"},"devDependencies":{"@types/node":"12.0.10","standard":"^10.0.3","tape":"^4.5.1","typescript":"3.5.2"},"dependencies":{"safe-buffer":"^5.0.1"},"gitHead":"90603b9349b124becc6a2bccaf31ee7b6b53943d","_id":"base-x@3.0.7","_nodeVersion":"10.16.0","_npmVersion":"6.11.2","dist":{"integrity":"sha512-zAKJGuQPihXW22fkrfOclUUZXM2g92z5GzlSMHxhO6r6Qj+Nm0ccaGNBzDZojzwOMkpjAv4J0fOv1U4go+a4iw==","shasum":"1c5a7fafe8f66b4114063e8da102799d4e7c408f","tarball":"http://registry-npm.ywwl.com/base-x/download/base-x-3.0.7.tgz","fileCount":5,"unpackedSize":9319,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdcHMWCRA9TVsSAnZWagAAc5QQAKKn2s1NgqeTA6cGoar+\nZjMT2FsweXIllRGj52i4ev+/64KZZjbF3cEfu5014EEX8UkUwwe3SCavwKRh\ngHuQe1HOssKS80mr/9iiLWb/kr0kJs//KcLwXGSIOc7Hk7PSfO92FqRQJDgA\nr1dIqK6lmoDyohUqcWW7rscDwRTp7FApYoVs3uXz5m4MtdZBYN7KbZUN8glv\nIPTVY88CQqY4ghVEP7eCDhJ6m5foj72RF7ejoE4+Fk397qSe6SvoTr4dGlN7\ngLDZI0IYcRF/7IDqjrfI/pFCfozEoDUPdfbZYHZKcUoeK8imojJQgPRWXSMj\nubC7536Y0vLprY5g3imKjEOU7kOMtEWvLBxiiWuyK3EdXBPYAi1kWIhzriEk\nCgKU2ZD/oH4OGLGQB7eh8YNMQkKp3V9Z2XfVLpqrFLZezk6/SchCnS2DRmSq\nmM2nhnIrfsShA55E9RkKSXZDL3V4pQfTFvmE7GHMwk8+eEse+dJjKsEDH5k1\nCga/Zp0Q4ESQAaicB2u26htEo6ZdS1dKsSljQltXbYuxJKQZu93z+7JULss9\nSS1YB0niD/HkU3miP+QQKmR6YAlQpMaHLiFI9vMbcoIGBCTVhG9UyPq+96lJ\nCp461QGSHfwkhl09ZU3JJGFKEd8lf3CMRwO5jMRjshiaBWhLYiSU7Dfva36C\nuXNL\r\n=xnnH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICdyahGGwRVnvA4z2SHKACgp8G3YOMJugRnrDEx1Mk+3AiEAhTohXSG2TwpUKiv/5GUUJhWNWVYb+MLwaWorfNw0i0s="}],"size":4012,"noattachment":false,"key":"/base-x/-/base-x-3.0.7.tgz"},"maintainers":[{"email":"npm@dcousens.com","name":"dcousens"},{"email":"fanatid@ya.ru","name":"fanatid"},{"email":"jprichardson@gmail.com","name":"jprichardson"},{"email":"junderwood@bitcoinbank.co.jp","name":"junderw"}],"_npmUser":{"name":"junderw","email":"junderwood@bitcoinbank.co.jp"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/base-x_3.0.7_1567650581745_0.47983390112576974"},"_hasShrinkwrap":false,"readme":"# base-x\n\n[![NPM Package](https://img.shields.io/npm/v/base-x.svg?style=flat-square)](https://www.npmjs.org/package/base-x)\n[![Build Status](https://img.shields.io/travis/cryptocoinjs/base-x.svg?branch=master&style=flat-square)](https://travis-ci.org/cryptocoinjs/base-x)\n\n[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)\n\nFast base encoding / decoding of any given alphabet using bitcoin style leading\nzero compression.\n\n**WARNING:** This module is **NOT RFC3548** compliant,  it cannot be used for base16 (hex), base32, or base64 encoding in a standards compliant manner. \n\n## Example\n\nBase58\n\n``` javascript\nvar BASE58 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'\nvar bs58 = require('base-x')(BASE58)\n\nvar decoded = bs58.decode('5Kd3NBUAdUnhyzenEwVLy9pBKxSwXvE9FMPyR4UKZvpe6E3AgLr')\n\nconsole.log(decoded)\n// => Uint8Array(33) [\n//   128, 237, 219, 220,  17, 104, 241, 218,\n//   234, 219, 211, 228,  76,  30,  63, 143,\n//    90,  40,  76,  32,  41, 247, 138, 210,\n//   106, 249, 133, 131, 164, 153, 222,  91,\n//    25\n// ]\n\nconsole.log(bs58.encode(decoded))\n// => 5Kd3NBUAdUnhyzenEwVLy9pBKxSwXvE9FMPyR4UKZvpe6E3AgLr\n```\n\n### Alphabets\n\nSee below for a list of commonly recognized alphabets, and their respective base.\n\nBase | Alphabet\n------------- | -------------\n2 | `01`\n8 | `01234567`\n11 | `0123456789a`\n16 | `0123456789abcdef`\n32 | `0123456789ABCDEFGHJKMNPQRSTVWXYZ`\n32 | `ybndrfg8ejkmcpqxot1uwisza345h769` (z-base-32)\n36 | `0123456789abcdefghijklmnopqrstuvwxyz`\n58 | `123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`\n62 | `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`\n64 | `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`\n67 | `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.!~`\n\n\n## How it works\n\nIt encodes octet arrays by doing long divisions on all significant digits in the\narray, creating a representation of that number in the new base. Then for every\nleading zero in the input (not significant as a number) it will encode as a\nsingle leader character. This is the first in the alphabet and will decode as 8\nbits. The other characters depend upon the base. For example, a base58 alphabet\npacks roughly 5.858 bits per character.\n\nThis means the encoded string 000f (using a base16, 0-f alphabet) will actually decode\nto 4 bytes unlike a canonical hex encoding which uniformly packs 4 bits into each\ncharacter.\n\nWhile unusual, this does mean that no padding is required and it works for bases\nlike 43. \n\n\n## LICENSE [MIT](LICENSE)\nA direct derivation of the base58 implementation from [`bitcoin/bitcoin`](https://github.com/bitcoin/bitcoin/blob/f1e2f2a85962c1664e4e55471061af0eaa798d40/src/base58.cpp),  generalized for variable length alphabets.\n","publish_time":1567650581871,"_cnpm_publish_time":1567650581871,"dist-tags":{"bp":"3.0.10","latest":"5.0.1"}}