1

I have to convert a utf8 character to its corresponding hex value in Elixir-Lang.

For example, if I pass "A" into the function, 41 is returned (which is the hex value for "A").

Any Suggestions?

Kshitij Mittal
  • 2,698
  • 3
  • 25
  • 40

1 Answers1

2

You are probably looking for Base.encode16/1:

iex> Base.encode16 "A"
"41"
Patrick Oscity
  • 53,604
  • 17
  • 144
  • 168