{"_id":"@multiformats/base-x","_rev":"3276906","name":"@multiformats/base-x","description":"Fast base encoding / decoding of any given alphabet","dist-tags":{"latest":"4.0.1"},"maintainers":[{"name":"achingbrain","email":"alex@achingbrain.net"},{"name":"alanshaw","email":""},{"name":"daviddias","email":"daviddias.p@gmail.com"},{"name":"hugomrdias","email":"mail@hugodias.me"},{"name":"lidel","email":""},{"name":"mikeal","email":""},{"name":"npm-service-account-multiformats","email":""},{"name":"rvagg","email":""},{"name":"vascosantos","email":"santos.vasco10@gmail.com"},{"name":"vmx","email":""}],"time":{"modified":"2024-03-21T10:32:01.000Z","created":"2020-09-16T21:57:05.033Z","4.0.1":"2020-09-16T22:01:28.011Z","4.0.0":"2020-09-16T21:57:05.033Z"},"users":{},"author":{"name":"Daniel Cousens"},"repository":{"type":"git","url":"https://github.com/gozala/@multiformats/base-x.git"},"versions":{"4.0.1":{"name":"@multiformats/base-x","version":"4.0.1","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/gozala/@multiformats/base-x","bugs":{"url":"https://github.com/gozala/@multiformats/base-x/issues"},"license":"MIT","author":{"name":"Daniel Cousens"},"main":"src/index.js","types":"src/index.d.ts","repository":{"type":"git","url":"https://github.com/gozala/@multiformats/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":"ed2301bd9925db236d63c0e0547fd7f4492f2e56","_id":"@multiformats/base-x@4.0.1","_nodeVersion":"12.18.4","_npmVersion":"6.14.6","dist":{"shasum":"95ff0fa58711789d53aefb2590a8b7a4e715d121","size":4106,"noattachment":false,"key":"/@multiformats/base-x/-/@multiformats/base-x-4.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/@multiformats/base-x/download/@multiformats/base-x-4.0.1.tgz"},"maintainers":[{"name":"achingbrain","email":"alex@achingbrain.net"},{"name":"alanshaw","email":""},{"name":"daviddias","email":"daviddias.p@gmail.com"},{"name":"hugomrdias","email":"mail@hugodias.me"},{"name":"lidel","email":""},{"name":"mikeal","email":""},{"name":"npm-service-account-multiformats","email":""},{"name":"rvagg","email":""},{"name":"vascosantos","email":"santos.vasco10@gmail.com"},{"name":"vmx","email":""}],"_npmUser":{"name":"mikeal","email":"mikeal.rogers@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/base-x_4.0.1_1600293687860_0.5238918259536192"},"_hasShrinkwrap":false,"publish_time":1600293688011,"_cnpm_publish_time":1600293688011,"_cnpmcore_publish_time":"2021-12-16T13:31:47.168Z"},"4.0.0":{"name":"@multiformats/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/gozala/@multiformats/base-x","bugs":{"url":"https://github.com/gozala/@multiformats/base-x/issues"},"license":"MIT","author":{"name":"Daniel Cousens"},"main":"src/index.js","types":"src/index.d.ts","repository":{"type":"git","url":"https://github.com/gozala/@multiformats/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":"cd2e383108e6fd9a12424db1ffc2b77a8df23784","_id":"@multiformats/base-x@4.0.0","_nodeVersion":"14.10.1","_npmVersion":"6.14.8","dist":{"shasum":"dc0a6c40f4c2221b311faed4ce73a1bb6b096ca6","size":4108,"noattachment":false,"key":"/@multiformats/base-x/-/@multiformats/base-x-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@multiformats/base-x/download/@multiformats/base-x-4.0.0.tgz"},"maintainers":[{"name":"achingbrain","email":"alex@achingbrain.net"},{"name":"alanshaw","email":""},{"name":"daviddias","email":"daviddias.p@gmail.com"},{"name":"hugomrdias","email":"mail@hugodias.me"},{"name":"lidel","email":""},{"name":"mikeal","email":""},{"name":"npm-service-account-multiformats","email":""},{"name":"rvagg","email":""},{"name":"vascosantos","email":"santos.vasco10@gmail.com"},{"name":"vmx","email":""}],"_npmUser":{"name":"mikeal","email":"mikeal.rogers@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/base-x_4.0.0_1600293424892_0.7412966418471054"},"_hasShrinkwrap":false,"publish_time":1600293425033,"_cnpm_publish_time":1600293425033,"_cnpmcore_publish_time":"2021-12-16T13:31:47.381Z"}},"readme":"# base-x\n\n(Hopefully temporary) fork of [base-x](https://github.com/cryptocoinjs/@multiformats/base-x) library which removed node [Buffer](https://nodejs.org/api/buffer.html) dependecy.\n\n[![NPM Package](https://img.shields.io/npm/v/@multiformats/base-x.svg?style=flat-square)](https://www.npmjs.org/package/@multiformats/base-x)\n[![Build Status](https://img.shields.io/travis/cryptocoinjs/@multiformats/base-x.svg?branch=master&style=flat-square)](https://travis-ci.org/cryptocoinjs/@multiformats/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('@multiformats/base-x')(BASE58)\n\nvar decoded = bs58.decode('5Kd3NBUAdUnhyzenEwVLy9pBKxSwXvE9FMPyR4UKZvpe6E3AgLr')\n\nconsole.log(decoded)\n// => <Buffer 80 ed db dc 11 68 f1 da ea db d3 e4 4c 1e 3f 8f 5a 28 4c 20 29 f7 8a d2 6a f9 85 83 a4 99 de 5b 19>\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+/`\n66 | `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","_attachments":{},"homepage":"https://github.com/gozala/@multiformats/base-x","bugs":{"url":"https://github.com/gozala/@multiformats/base-x/issues"},"license":"MIT"}