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 "encoding/hex"
s := hex.EncodeToString(a)
s := '';
for b in a do s := s + IntToHex(b,2);

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

Idiom created by

Related idioms