Skip to content
This repository was archived by the owner on Jan 18, 2023. It is now read-only.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hexa

A simple module for Hexadecimal encoding / decoding in Elixir

Usage

Encode to binary:

iex> Hexa.encode("This is a test.")
     "54686973206973206120746573742e"

iex> Hexa.encode('This is a test.')
     "54686973206973206120746573742e"

iex> Hexa.encode(123456)
     "1e240"

Decode to binary:

iex> Hexa.decode("54686973206973206120746573742e")
     "This is a test."

iex> Hexa.decode('54686973206973206120746573742e')
     "This is a test."

Encode to list:

iex> Hexa.encode_to_list('This is a test.')
     '54686973206973206120746573742e'

iex> Hexa.encode_to_list("This is a test.")
     '54686973206973206120746573742e'

iex> Hexa.encode(123456)
     '1e240'

Decode to list:

iex> Hexa.decode('54686973206973206120746573742e')
     'This is a test.'

iex> Hexa.decode("54686973206973206120746573742e")
     'This is a test.'

Convert hex to integer:

iex> Hexa.to_integer('54686973206973206120746573742e')
     438270661302729020147902120434299950

iex> Hexa.to_integer("54686973206973206120746573742e")
     438270661302729020147902120434299950

About

A simple module for Hex encoding / decoding in Elixir. Renammed forked of https://github.com/rjsamson/hex

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages