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 314 views
314 views asked Apr 9, 2021 by avibootz
3 answers 358 views
358 views asked Apr 9, 2021 by avibootz
1 answer 260 views
260 views asked Apr 25, 2021 by avibootz
1 answer 215 views
1 answer 287 views
1 answer 267 views
1 answer 189 views
...