{"name":"base-x","version":"1.0.2","description":"Fast base encoding / decoding of any given alphabet","main":"index.js","scripts":{"standard":"standard","test":"npm run unit && npm run standard","unit":"mocha"},"repository":{"type":"git","url":"git+https://github.com/dcousens/base-x.git"},"bugs":{"url":"https://github.com/dcousens/base-x/issues"},"homepage":"https://github.com/dcousens/base-x","keywords":["base-x","base58","base62","base64","crypto","crytography","decode","decoding","encode","encoding"],"author":{"name":"Daniel Cousens"},"license":"MIT","devDependencies":{"mocha":"*","standard":"*"},"gitHead":"4819ddb01fcc35d46f943319090234a0980cce3d","_id":"base-x@1.0.2","_shasum":"6f58f5c8a8a3cf1fad3849e194b505897d4aec4e","_from":".","_npmVersion":"3.5.3","_nodeVersion":"5.4.1","_npmUser":{"name":"dcousens","email":"email@dcousens.com"},"dist":{"shasum":"6f58f5c8a8a3cf1fad3849e194b505897d4aec4e","tarball":"http://registry-npm.ywwl.com/base-x/download/base-x-1.0.2.tgz","integrity":"sha512-CzfPeJUxQWPmxFhSmyMdTrPCQDMr1gcpn0T4KrsoJyWFgl7Pk15YlILlZZgzXTPNXymPHPbCjP9iEEG5N0vlFw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFFzfTfxBuXggyXz2Ybz9y/DSxGA5fSh2wYZgleuTxVqAiEA81uhZiZYxs4lV21Wbs6uSiCeSD2XwkGibFcmQovf2+Q="}],"size":2669,"noattachment":false,"key":"/base-x/-/base-x-1.0.2.tgz"},"maintainers":[{"name":"dcousens","email":"email@dcousens.com"}],"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":1453251011925,"_cnpm_publish_time":1453251011925,"dist-tags":{"bp":"3.0.10","latest":"5.0.1"}}