{"id":13591655,"url":"https://github.com/cryptocoinjs/base-x","last_synced_at":"2025-05-14T04:03:11.401Z","repository":{"id":32284323,"uuid":"35859107","full_name":"cryptocoinjs/base-x","owner":"cryptocoinjs","description":"Encode/decode any base","archived":false,"fork":false,"pushed_at":"2025-03-08T01:07:56.000Z","size":197,"stargazers_count":323,"open_issues_count":2,"forks_count":77,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-05-09T03:33:04.188Z","etag":null,"topics":["alphabet","base","base58","bitcoin","decoding","encoding"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"tedsluis/openshift-backup","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cryptocoinjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-05-19T04:25:00.000Z","updated_at":"2025-05-06T08:19:14.000Z","dependencies_parsed_at":"2024-08-30T10:33:13.805Z","dependency_job_id":"26e772c5-5d22-4e3f-837c-b9f9cc14ecd0","html_url":"https://github.com/cryptocoinjs/base-x","commit_stats":{"total_commits":113,"total_committers":13,"mean_commits":8.692307692307692,"dds":0.6371681415929203,"last_synced_commit":"64e196c84f1d0b51eb7650d3881868568a0f525c"},"previous_names":["dcousens/base-x"],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cryptocoinjs%2Fbase-x","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cryptocoinjs%2Fbase-x/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cryptocoinjs%2Fbase-x/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cryptocoinjs%2Fbase-x/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cryptocoinjs","download_url":"https://codeload.github.com/cryptocoinjs/base-x/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253843195,"owners_count":21972872,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alphabet","base","base58","bitcoin","decoding","encoding"],"created_at":"2024-08-01T16:01:00.276Z","updated_at":"2025-05-14T04:03:11.348Z","avatar_url":"https://github.com/cryptocoinjs.png","language":"JavaScript","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\u0026style=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// =\u003e 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// =\u003e 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","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcryptocoinjs%2Fbase-x","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcryptocoinjs%2Fbase-x","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcryptocoinjs%2Fbase-x/lists"}