Logo

Programming-Idioms

History of Idiom 176 > diff from v10 to v11

Edit summary for version 11 by programming-idioms.org:
[Python] +DocURL (for python 3)

Version 10

2019-03-19, 16:44:16

Version 11

2019-03-26, 21:23:37

Idiom #176 Hex string to byte array

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

Idiom #176 Hex string to byte array

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

Extra Keywords
hexa
Extra Keywords
hexa
Code
a = bytearray.fromhex(s)
Code
a = bytearray.fromhex(s)
Doc URL
https://docs.python.org/3/library/stdtypes.html#bytearray.fromhex