ProductPromotion
Logo

Elixir

made by https://0x3d.site

GitHub - rjsamson/hexate: A simple module for Hex encoding / decoding in Elixir.
A simple module for Hex encoding / decoding in Elixir. - rjsamson/hexate
Visit Site

GitHub - rjsamson/hexate: A simple module for Hex encoding / decoding in Elixir.

GitHub - rjsamson/hexate: A simple module for Hex encoding / decoding in Elixir.

Hexate

Build Status Hex.pm Hex.pm

A simple module for hexadecimal encoding / decoding in Elixir.

Note: name change from hex to hexate

Now that Elixir includes integration with Hex.pm, the library has been renamed hexate to avoid namespace clashes.

This was manifesting itself with intermittent failures when running test suites. If you experience this, update your deps!

If you really must use the old version, it's on the branch pre-rename-to-hexate.

Adding to your mix.exs

defp deps do
  [
    {:hexate,  ">= 0.6.0"}
  ]
end

Usage

Encode to string (binary):

# From a string
iex> Hexate.encode("This is a test.")
     "54686973206973206120746573742e"

# From a char-list
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"

Decode to string (binary):

# From a hex string
iex> Hexate.decode("54686973206973206120746573742e")
     "This is a test."

# From a hex char-list
iex> Hexate.decode('54686973206973206120746573742e')
     "This is a test."

Encode to hex char-list:

# From a unicode char-list
iex> Hexate.encode_to_list('This is a test.')
     '54686973206973206120746573742e'

# From a unicode string
iex> Hexate.encode_to_list("This is a test.")
     '54686973206973206120746573742e'

# From an integer
iex> Hexate.encode_to_list(123456)
     '1e240'

Decode to unicode char-list:

# From a hex char-list
iex> Hexate.decode_to_list('54686973206973206120746573742e')
     'This is a test.'

# From a hex string
iex> Hexate.decode_to_list("54686973206973206120746573742e")
     'This is a test.'

Convert hex to integer:

# From hex char-list
iex> Hexate.to_integer('54686973206973206120746573742e')
     438270661302729020147902120434299950

# From hex string
iex> Hexate.to_integer("54686973206973206120746573742e")
     438270661302729020147902120434299950

Contributing

  • Fork this repo
  • Make a feature branch
  • Issue a pull request

Running tests

mix deps.get
mix test.watch

Authors

Robert J Samson David Parry

Articles
to learn more about the elixir concepts.

Resources
which are currently available to browse on.

mail [email protected] to add your project or resources here 🔥.

FAQ's
to know more about the topic.

mail [email protected] to add your project or resources here 🔥.

Queries
or most google FAQ's about Elixir.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory