hexate v0.6.1 Hexate
A simple module to convert to and from hex encoded strings.
Encodes / decodes both char-lists and strings.
Summary
Functions
Returns a decoded binary from a hex string in either char-list or string form
Returns a decoded char-list from a hex string in either char-list or string form
Returns a hex encoded string from a char-list, string or integer
Returns a hex encoded list from a char-list, string or integer
Returns an integer representation of a given string of hex, taking a char-list or a string as an argument
Functions
Returns a decoded binary from a hex string in either char-list or string form.
Examples
iex> Hexate.decode("54686973206973206120746573742e")
"This is a test."
iex> Hexate.decode('54686973206973206120746573742e')
"This is a test."
Returns a decoded char-list from a hex string in either char-list or string form.
Examples
iex> Hexate.decode_to_list("54686973206973206120746573742e")
'This is a test.'
iex> Hexate.decode_to_list('54686973206973206120746573742e')
'This is a test.'
Returns a hex encoded string from a char-list, string or integer.
Examples
iex> Hexate.encode("This is a test.")
"54686973206973206120746573742e"
iex> Hexate.encode('This is a test.')
"54686973206973206120746573742e"
iex> Hexate.encode(123456)
"1e240"
iex> Hexate.encode(15, 4)
"000f"
iex> Hexate.encode(15.0, 2)
"0f"
iex> Hexate.encode(15.0)
"f"
Returns a hex encoded list from a char-list, string or integer.
Examples
iex> Hexate.encode_to_list("This is a test.")
'54686973206973206120746573742e'
iex> Hexate.encode_to_list('This is a test.')
'54686973206973206120746573742e'
iex> Hexate.encode_to_list(123456)
'1e240'
Returns an integer representation of a given string of hex, taking a char-list or a string as an argument.
Examples
iex> Hexate.to_integer('54686973206973206120746573742e')
438270661302729020147902120434299950
iex> Hexate.to_integer("54686973206973206120746573742e")
438270661302729020147902120434299950