dex
v1.1.0
Published
Translate data from base-from into base-to and back
Downloads
35
Readme
dex
Translate data from base
a
into basen
and back
Install
From npm
npm install --save dex
dex.hex(input)
Returns input
converted into base16 representation. Assumes input
is a base10 string, or a Number
.
dex.dec(input)
Returns input
converted into base10 representation. Assumes input
is a base16 string.
dex(input, from, to)
Returns input
converted into baseto
representation. Assumes input
is a basefrom
string.
Notes
dex
accepts only non-empty strings and numericinput
s, every otherinput
value will result innull
being returnedinput
gets lowercased bydex
, so you don't need to- Result is always a lowercase string representation of the number in the requested notation
CLI
dex <input> [from] [to]
Prints to standard output the results of doing dex(input, from=16, to=10)
.
License
MIT