About 91,300 results
Open links in new tab
  1. How to encode text to base64 in python - Stack Overflow

    The bytes function creates a bytes object from the string "your_string" using UTF-8 encoding. In Python, bytes represents a sequence of bits and UTF-8 specifies the character encoding to …

  2. python - Why do I need 'b' to encode a string with Base64

    I followed an example from the documentation of how to use Base64 encoding in Python: >>> import base64 >>> encoded = base64.b64encode (b'data to be encoded') >>> encoded b'

  3. How do you decode Base64 data in Python? - Stack Overflow

    Jul 19, 2021 · I have the following piece of Base64 encoded data, and I want to use the Python Base64 module to extract information from it. It seems that module does not work. How can I …

  4. How to decode base64 url in Python? - Stack Overflow

    In python there is base64.b64encode but that only base64 encodes and its is different from base64 url encoding. Here is the right set to of steps to convert form base64encoded to …

  5. python - Encoding an image file with base64 - Stack Overflow

    Feb 1, 2015 · I want to encode an image into a string using the base64 module. I've ran into a problem though. How do I specify the image I want to be encoded? I tried using the directory …

  6. Base64 Authentication Python - Stack Overflow

    Aug 9, 2013 · You can see that base64.b64encode requires a bytes-like object (bytes, bytearray, etc.) as its input and also returns such objects as its output, so we have to use encode() for …

  7. Base 64 encode a JSON variable in Python - Stack Overflow

    Jul 18, 2014 · In Python 3.x you need to convert your str object to a bytes object for base64 to be able to encode them. You can do that using the str.encode method:

  8. python - Convert byte string to base64-encoded string (output …

    base64 has been intentionally classified as a binary transform.... It was a design decision in Python 3 to force the separation of bytes and text and prohibit implicit transformations.

  9. python - Base64 encoding in python3 - Stack Overflow

    LookupError: 'base64' is not a text encoding; use codecs.encode() to handle arbitrary codecs This line seemed to work fine in python 2 but since switching to 3 I get the error

  10. How to encode a image in Python to Base64? - Stack Overflow

    Dec 3, 2019 · 12 You can encode the RGB directly to jpg in memory and create a base64 encoding of this.