{"name":"base-x","version":"5.0.0","description":"Fast base encoding / decoding of any given alphabet","type":"module","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/cjs/index.cjs","module":"src/esm/index.js","types":"src/cjs/index.d.ts","exports":{".":{"require":"./src/cjs/index.cjs","import":"./src/esm/index.js","types":"./src/cjs/index.d.ts"}},"repository":{"type":"git","url":"git+https://github.com/cryptocoinjs/base-x.git"},"scripts":{"build":"npm run clean && tsc -p ./tsconfig.json && tsc -p ./tsconfig.cjs.json; npm run standard -- --fix","clean":"rimraf src","postbuild":"find src/cjs -type f -name \"*.js\" -exec bash -c 'mv \"$0\" \"${0%.js}.cjs\"' {} \\;","gitdiff":"npm run build && git diff --exit-code","prepublish":"npm run gitdiff","standard":"standard --ignore test","test":"npm run unit && npm run standard","unit":"tape test/*.js"},"devDependencies":{"@types/node":"12.0.10","rimraf":"^3.0.2","standard":"^17.1.0","tape":"^5.3.0","typescript":"^5.4.5"},"gitHead":"125c2030a069588701bea4a5981cb93cd403105e","_id":"base-x@5.0.0","_nodeVersion":"18.16.1","_npmVersion":"9.5.1","dist":{"integrity":"sha512-sMW3VGSX1QWVFA6l8U62MLKz29rRfpTlYdCqLdpLo1/Yd4zZwSbnUaDfciIAowAqvq7YFnWq9hrhdg1KYgc1lQ==","shasum":"6d835ceae379130e1a4cb846a70ac4746f28ea9b","tarball":"http://registry-npm.ywwl.com/base-x/download/base-x-5.0.0.tgz","fileCount":6,"unpackedSize":14043,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHKifrPoWBwxTJQuSv3Sf+mbGey639TSwEYNzhcPHQtwAiEA572gey6HA2YjQAV4GFSENooz1UNStTasO32ykJV1KfE="}],"size":4348,"noattachment":false,"key":"/base-x/-/base-x-5.0.0.tgz"},"_npmUser":{"name":"junderw","email":"jonathan.underwood4649@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/base-x_5.0.0_1719061735999_0.395576147558776"},"_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'\nimport basex from 'base-x'\nvar bs58 = basex(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":1719061736160,"maintainers":[{"name":"fanatid","email":"fanatid@ya.ru"},{"name":"jprichardson","email":"jprichardson@gmail.com"},{"name":"junderw","email":"jonathan.underwood4649@gmail.com"}],"_cnpm_publish_time":1719061736160,"dist-tags":{"bp":"3.0.10","latest":"5.0.1"}}