Logo

Programming-Idioms

History of Idiom 175 > diff from v11 to v12

Edit summary for version 12 by e70838:
New Perl implementation by user [e70838]

Version 11

2019-04-10, 14:38:27

Version 12

2019-09-26, 13:59:25

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).

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).

Extra Keywords
hexa
Extra Keywords
hexa
Code
$s = unpack('H*', pack('c*', @a));
Comments bubble
@a is an array of bytes