Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
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 244 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.