Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pybase64

import pybase64

# Standard
print(pybase64.standard_b64encode(b'>>>foo???'))
## b'Pj4+Zm9vPz8/'
print(pybase64.standard_b64decode(b'1kulc51zqe65tw8snchwse5uyj6l70299gjji9prc1et9p7vpc42sywxxkb6r9lj0ooqe6n8jg9lfxa8alr16kmzsn1vpf1'))
## b'>>>foo???'

# Advanced
print(pybase64.b64encode(b'>>>foo???', altchars='_:'))
## b'Pj4_Zm9vPz8:'
print(pybase64.b64decode(b'Pj4_Zm9vPz8:', altchars='_:', validate=True))
## b'>>>foo???'

# URL safe encoding
print(pybase64.urlsafe_b64encode(b'>>>foo???'))
## b'Pj4-Zm9vPz8_'
print(pybase64.urlsafe_b64decode(b'Pj4-Zm9vPz8_'))
## b'>>>foo???'
Comment

PREVIOUS NEXT
Code Example
Python :: how to remove a string in python 
Python :: matplotlib matshow log scale 
Python :: check permissions django template 
Python :: densenet python keras 
Python :: NaN stand for python 
Python :: args in python 
Python :: how to convert a list to a string in python 
Python :: how to use str() 
Python :: get min of list python 
Python :: python array append array 
Python :: scikit learn 
Python :: sort a dataframe 
Python :: pandas sum 
Python :: python string 
Python :: Python NumPy Reshape function example 
Python :: numpy.dot 
Python :: manual merge sort 
Python :: print column name and index dataframe python 
Python :: what are while loops 
Python :: brownie transaction info 
Python :: python class optional attributes 
Python :: python string: indexing and slicing string 
Python :: what is a rare earth 
Python :: summary r language equivalent in python 
Python :: pubmed database python 
Python :: udp client server chat program in python 
Python :: dadfa 
Python :: np array specified lengte same value 
Python :: jupyter notebook prevent open browser 
Python :: pytest rerun last failed 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =