
Security News
Node.js TSC Votes to Stop Distributing Corepack
Corepack will be phased out from future Node.js releases following a TSC vote.
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 408 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
Corepack will be phased out from future Node.js releases following a TSC vote.
Research
Security News
Research uncovers Black Basta's plans to exploit package registries for ransomware delivery alongside evidence of similar attacks already targeting open source ecosystems.
Security News
Oxlint's beta release introduces 500+ built-in linting rules while delivering twice the speed of previous versions, with future support planned for custom plugins and improved IDE integration.