Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
base-conversion-from-dec
Advanced tools
Auto-curried converter to any base with arbitrary precision support and customisable symbols
Auto-curried converter to any base with arbitrary precision support and customisable symbols.
For the opposite behaviour, see base-conversion-to-dec. For any to any base conversions, see base-conversion.
npm i base-conversion-from-dec
var bc = require('base-conversion-from-dec');
var toBin = bc(2);
hexToBin('10'); //=> '1010'
hexToBin(30); //=> '11110'
See spec.
For any bases above 62, custom symbols are required. See tests for working examples.
var bc = require('base-conversion-from-dec');
bc.symbols('⓿①②③④⑤⑥⑦⑧⑨ⒶⒷ', 12, '⑦③'); //=> '⑥①'
var bc = require('base-conversion-from-dec');
var Big = require('arbitrary-precision')(require('bigjs-adapter'));
var toBigFactory = require('to-decimal-arbitrary-precision');
var d = toBigFactory(Big);
// avoid large numbers to go into exponential notation (adapter dependent)
Big.Impl.E_POS = 50;
bc.big(d, 9, '5678364565345634563456346757364563534534645745');
//=> '802531310452364303450750087576673257456135727727'
var bc = require('base-conversion-from-dec');
var Big = require('arbitrary-precision')(require('bigjs-adapter'));
var toBigFactory = require('to-decimal-arbitrary-precision');
var d = toBigFactory(Big);
// avoid large numbers to go into exponential notation (adapter dependent)
Big.Impl.E_POS = 50;
bc.raw(d, '01234#6789', 9, '#678364#6#34#634#634#63467#7364#63#34#3464#74#');
//=> '802#313104#23643034#07#0087#766732#74#613#727727'
The default symbols and big implementation are exposed as follows:
bc.defaultSymbols; //=> '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
bc.defaultB; //=> default arbitrary precision implementation (div & mod)
FAQs
Auto-curried converter to any base with arbitrary precision support and customisable symbols
The npm package base-conversion-from-dec receives a total of 14 weekly downloads. As such, base-conversion-from-dec popularity was classified as not popular.
We found that base-conversion-from-dec 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.