This language bar is your friend. Select your favorite languages!

Idiom #175 Bytes to hex string

From array a of n bytes, build the equivalent hex string s of 2n digits.
Each byte (256 possible values) is encoded as two hexadecimal characters (16 possible values per digit).

s = a.unpack("H*")
import std.digest;
s = a.toHexString;
import "encoding/hex"
s := hex.EncodeToString(a)
s := '';
for b in a do s := s + IntToHex(b,2);
s = a.hex()

Do you know the best way to do this in your language ?
New implementation...

Idiom created by

Related idioms