Skip to content

Get Base64 of a string in Python

Advertisements
import base64


# Get the base-64 of the string.
def get_base_64_of_string(your_string):
    return base64.b64encode(your_string.encode()).decode()


def main():
    # Get the base-64 of the string.
    print(get_base_64_of_string("Hello World!"))


main()

See also  PHP code snippet - How to set application key in lumen?

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.