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 202 views
202 views asked Apr 9, 2021 by avibootz
3 answers 227 views
227 views asked Apr 9, 2021 by avibootz
1 answer 175 views
175 views asked Apr 25, 2021 by avibootz
1 answer 108 views
1 answer 197 views
1 answer 167 views
1 answer 106 views
...