Remove the new line “\n” from base64 encoded strings in Python3?

后端 未结 4 2098
感情败类
感情败类 2021-02-05 03:15

I\'m trying to make a HTTPS connection in Python3 and when I try to encode my username and password the base64 encodebytes method returns the encoded v

4条回答
  •  清歌不尽
    2021-02-05 04:11

    for python3 use:-

    binascii.b2a_base64(cipher_text, newline=False)

    for python2 use:

    binascii.b2a_base64(cipher_text)[:-1]

提交回复
热议问题