How to convert a hex to a list of bytes in Python

1 Answer

0 votes
hex_string = "1A2D3E4F";

list_of_bytes = list(bytes.fromhex(hex_string))

print(list_of_bytes)



'''
run:

[26, 45, 62, 79]

'''

 



answered Feb 14, 2025 by avibootz
edited Feb 14, 2025 by avibootz

Related questions

2 answers 307 views
307 views asked Apr 9, 2021 by avibootz
3 answers 348 views
348 views asked Apr 9, 2021 by avibootz
1 answer 253 views
253 views asked Apr 25, 2021 by avibootz
1 answer 211 views
1 answer 281 views
1 answer 257 views
1 answer 183 views
...