{"name":"base-x","version":"4.0.0","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"},"gitHead":"dd4c308377e8d4e4f62939fdc5cfa857b11ee608","_id":"base-x@4.0.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw==","shasum":"d0e3b7753450c73f8ad2389b5c018a4af7b2224a","tarball":"http://registry-npm.ywwl.com/base-x/download/base-x-4.0.0.tgz","fileCount":5,"unpackedSize":9437,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiDa5tCRA9TVsSAnZWagAAZOEQAIWDShfQwAibtOxZuw9X\nm/sFAXEkxBnKjRM0TX5jLyDTTBluR+KBQ8umh2p10HM6wdg+cQn28pU3sNsh\nF8GD9KvqZGiXryqODxuhbqYx5kUfQpKRFjr8ufN788V2tOiLLx+bxsXaJVNb\nOneYAVEW3zzL5eKigW7a3w2y5ri2En88QikeQhflyBLA8Xkcq5ygUTE+vNe4\nLsEevmWzc7SfnoA9K1Do2snKKovlTeKtPI4S8WXKdfIpZ9wRMYiFaNlkpCDv\n65yiusOwL/y3iQNbMjlPWGWrj0btWmOSxI2gWAK7/rew5N7VY0FKIbJ2vFY0\n0p4WvF5HlvnPck2NUuMC8/GOrzg7cOsBK1CP+CoY8ag3Nz8h8kP041YhjoSt\n2Hac36z8EHjqeqD5ZOtdDy7YYWMKAmZO0avT4UFht2sgRs3cHlSkdVRrY9QE\n2/yzOWAXb4eC0wMmdPDuHlpD0Uw8Szm3RFmO6nRu2fEFCRKzTXyHUfB5IFvB\n9M3hnrDl5tWKRk+s2fp+4YWMyryjzWkeHtewKQowNJy5ndevkTlYmN4Yrl+n\naUi3JPcXqKyXnBL3XvwP2AD/ik0cdCqWLThwWKtdro+moHhSfA3P7lyUSIKN\ncdf07D6av850+ouPDzAOpLsHfSONzmGUKSHQTDbg2PvV8mIXQf95v4aJDU+i\nfIB6\r\n=hp88\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD8/8TGEuQHpS2Janz2pVFgmqmNpam1jNDUPra/w/q7UQIgd8G/p4+U+tZcMlZmChjAZrxh3oaUtBCARUS4qYMvXtM="}],"size":4034,"noattachment":false,"key":"/base-x/-/base-x-4.0.0.tgz"},"_npmUser":{"name":"junderw","email":"junderwood@bitcoinbank.co.jp"},"directories":{},"maintainers":[{"name":"fanatid","email":"fanatid@ya.ru"},{"name":"jprichardson","email":"jprichardson@gmail.com"},{"name":"junderw","email":"junderwood@bitcoinbank.co.jp"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/base-x_4.0.0_1645063788993_0.24881182798346502"},"_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":1645063789127,"_cnpm_publish_time":1645063789127,"dist-tags":{"bp":"3.0.10","latest":"5.0.1"}}