Gathering detailed insights and metrics for base-x
Gathering detailed insights and metrics for base-x
Gathering detailed insights and metrics for base-x
Gathering detailed insights and metrics for base-x
npm install base-x
Typescript
Module System
Node Version
NPM Version
99.9
Supply Chain
91.2
Quality
83.2
Maintenance
100
Vulnerability
100
License
JavaScript (73.09%)
TypeScript (26.91%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
328 Stars
138 Commits
77 Forks
13 Watchers
9 Branches
23 Contributors
Updated on Jul 09, 2025
Latest Version
5.0.1
Package Id
base-x@5.0.1
Unpacked Size
14.04 kB
Size
4.33 kB
File Count
6
NPM Version
10.8.2
Node Version
22.5.1
Published on
Mar 08, 2025
Cumulative downloads
Total Downloads
5
Fast base encoding / decoding of any given alphabet using bitcoin style leading zero compression.
WARNING: This module is NOT RFC3548 compliant, it cannot be used for base16 (hex), base32, or base64 encoding in a standards compliant manner.
Base58
1var BASE58 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' 2import basex from 'base-x' 3var bs58 = basex(BASE58) 4 5var decoded = bs58.decode('5Kd3NBUAdUnhyzenEwVLy9pBKxSwXvE9FMPyR4UKZvpe6E3AgLr') 6 7console.log(decoded) 8// => Uint8Array(33) [ 9// 128, 237, 219, 220, 17, 104, 241, 218, 10// 234, 219, 211, 228, 76, 30, 63, 143, 11// 90, 40, 76, 32, 41, 247, 138, 210, 12// 106, 249, 133, 131, 164, 153, 222, 91, 13// 25 14// ] 15 16console.log(bs58.encode(decoded)) 17// => 5Kd3NBUAdUnhyzenEwVLy9pBKxSwXvE9FMPyR4UKZvpe6E3AgLr
See below for a list of commonly recognized alphabets, and their respective base.
Base | Alphabet |
---|---|
2 | 01 |
8 | 01234567 |
11 | 0123456789a |
16 | 0123456789abcdef |
32 | 0123456789ABCDEFGHJKMNPQRSTVWXYZ |
32 | ybndrfg8ejkmcpqxot1uwisza345h769 (z-base-32) |
36 | 0123456789abcdefghijklmnopqrstuvwxyz |
58 | 123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz |
62 | 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ |
64 | ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/ |
67 | ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.!~ |
It encodes octet arrays by doing long divisions on all significant digits in the array, creating a representation of that number in the new base. Then for every leading zero in the input (not significant as a number) it will encode as a single leader character. This is the first in the alphabet and will decode as 8 bits. The other characters depend upon the base. For example, a base58 alphabet packs roughly 5.858 bits per character.
This means the encoded string 000f (using a base16, 0-f alphabet) will actually decode to 4 bytes unlike a canonical hex encoding which uniformly packs 4 bits into each character.
While unusual, this does mean that no padding is required and it works for bases like 43.
A direct derivation of the base58 implementation from bitcoin/bitcoin
, generalized for variable length alphabets.
0/10
Summary
Homograph attack allows Unicode lookalike characters to bypass validation.
Affected Versions
<= 3.0.10
Patched Versions
3.0.11
0/10
Summary
Homograph attack allows Unicode lookalike characters to bypass validation.
Affected Versions
= 4.0.0
Patched Versions
4.0.1
0/10
Summary
Homograph attack allows Unicode lookalike characters to bypass validation.
Affected Versions
= 5.0.0
Patched Versions
5.0.1
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
2 existing vulnerabilities detected
Details
Reason
Found 6/13 approved changesets -- score normalized to 4
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreLast Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year