-1

I have the following script:

hex_string = "c23dba5fcac1048b3c050266ceb6a0e870670021"
hex_bytes = bytearray.fromhex(hex_raw)
print(hex_bytes.reverse())

The problem it prints/returns None. I was wondering, because in this example it works.

Thanks in advance.

kabr8
  • 341
  • 1
  • 2
  • 19

1 Answers1

3

I found the issue. The method .reverse() dont return anything, but changes the bytearray, so the code must be:

hex_string = "c23dba5fcac1048b3c050266ceb6a0e870670021"
hex_bytes = bytearray.fromhex(hex_raw)
hex_bytes.reverse()
print(hex_bytes)
kabr8
  • 341
  • 1
  • 2
  • 19