B
B
Bastax132018-04-20 21:13:33
Python
Bastax13, 2018-04-20 21:13:33

How to convert "byte" string to bytes?

The server using json returns the string sign and publickey (electronic signature, rsa module ).
There was a problem with the transfer of the signature, because. it is bytes , but I cannot decode it into a string, because invalid start byte . I have to pass it as a string, without decoding.
It turns out that in the program I get str: b'5\xbe`\x00=\xd6\xd8h\x1f[`'
Verification works only with bytes, but when I try to do bytes(), it gives out something like bytes: b"b'5\xbe`\x00=\xd6\xd8h\x1f[`'", i.e. two times b, and, of course, the check fails. How can this string
be converted to bytes, given that it already contains bytes? Or how can I transfer the signature (bytes) differently?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
planc, 2018-04-20
@Bastax13

base64

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question