npm.io
1.1.0 • Published 11 years agoCLI

dex

Licence
MIT
Version
1.1.0
Deps
0
Vulns
0
Weekly
0
Stars
3

dex

Translate data from basea 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 numeric inputs, every other input value will result in null being returned
  • input gets lowercased by dex, 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