{"name":"base-x","version":"3.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"},"files":["index.js"],"main":"index.js","repository":{"type":"git","url":"git+https://github.com/cryptocoinjs/base-x.git"},"scripts":{"standard":"standard","test":"npm run unit && npm run standard","unit":"tape test/*.js"},"devDependencies":{"standard":"^6.0.8","tape":"^4.5.1"},"engines":{"node":">=4.5.0"},"gitHead":"a5eb6c8d6c172de496e1ebcd372ac584873ef149","_id":"base-x@3.0.0","_shasum":"77b56f0311070b780b3c8a5f534beac47e506702","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.5.0","_npmUser":{"name":"dcousens","email":"email@dcousens.com"},"dist":{"shasum":"77b56f0311070b780b3c8a5f534beac47e506702","tarball":"http://registry-npm.ywwl.com/base-x/download/base-x-3.0.0.tgz","integrity":"sha512-7ThOK0tANS8DcvdLIWzXpHaN0rg+28SUyf7uLhzUwRU4bQzKZldLBgaJJ0Ckt2sj9L+yQo80iJToHQWhLTzQgw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB80cdl7U+i6D4BJf1e1rlugL7Kx99GTb/84opPEzD0zAiBAOinX6mFhqEvpkzeMPvxIAgs1soc6/3d9zMv72mWK4A=="}],"size":3307,"noattachment":false,"key":"/base-x/-/base-x-3.0.0.tgz"},"maintainers":[{"name":"dcousens","email":"email@dcousens.com"},{"name":"jprichardson","email":"jprichardson@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/base-x-3.0.0.tgz_1486967472840_0.780504023656249"},"directories":{},"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":1486967473081,"_cnpm_publish_time":1486967473081,"dist-tags":{"bp":"3.0.10","latest":"5.0.1"}}