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?
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?
You are probably looking for Base.encode16/1
:
iex> Base.encode16 "A"
"41"