1.1.0 • Published 9 years ago

dex v1.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

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