
Security News
NVD Concedes Inability to Keep Pace with Surging CVE Disclosures in 2025
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
simple-base-converter
Advanced tools
master:
Simple math module for base conversion.
npm i simple-base-converter
Some bases(2, 8, 16, 32, 36, 62) are predefined.
import { _10To2, _2To10 } from "simple-base-converter";
_10To2(100); // "1100100"
_2To10(1100100); // "100"
// Input can be both integer or string number.
_10To2("100"); // "1100100"
_2To10("1100100"); // "100"
Of course you can choose bases freely.
convertBase(num, originalBase, newBase)
converts num from originalBase to newBase.
If you set integer to originalBase or newBase, they are automatically converted by using default base 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
.
import { convertBase } from "simple-base-converter";
convertBase("20a4", 17, 52); // "3Ag"
convertBase("20a4", "0123456789abcdefg", "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP"); // "3Ag"
Custom bases are also available.
convertBase(10000, 10, "-・"); // "・--・・・---・----"
convertBase("4649", "0123456789", "零一二三四五六七八九"); // "四六四九"
FAQs
Simple math module for base conversion.
The npm package simple-base-converter receives a total of 419 weekly downloads. As such, simple-base-converter popularity was classified as not popular.
We found that simple-base-converter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
Security Fundamentals
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.
Security News
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.