-2

I have an encoded string stored in my DB that kinda looks like this (altered for confidentiality):

\x7b22747c

How do I decode this string? (Using either Java or Python)

There is code elsewhere that used tobytes() function to decode it. But I don't own the code so I am not sure what it's doing.

ritratt
  • 1,703
  • 4
  • 25
  • 45

1 Answers1

0

The comments helped in looking in the right place.

Here is what worked for me:

bytes.fromhex('7b22747').decode()

So I just had to remove the \x and then just decode the remaining string which was an encoded hex string.

Patrick Artner
  • 50,409
  • 9
  • 43
  • 69
ritratt
  • 1,703
  • 4
  • 25
  • 45