Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pybase64 tutorial

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 :: float field vs decimal field in django models 
Python :: what is self 
Python :: service 
Python :: best jarvis code in python 
Python :: python takes 2 positional arguments but 3 were given 
Python :: how to create list in python 
Python :: python array of objects 
Python :: comment all selected lines in python 
Python :: activate virtual environment python in linux 
Python :: how to read an xml file 
Python :: if queryset is empty django 
Python :: python use cases 
Python :: add column to dataframe pandas 
Python :: np.divide 
Python :: how to make loop python 
Python :: python cast to int 
Python :: python pandas how to check in what columns there are empty values(NaN) 
Python :: print column name and index 
Python :: indefinite loops python 
Python :: deactivate pandas warning copy 
Python :: Python, variables, Print() advanced, Input(), Variables ,INT, STR, FLOAT, BOOL, Casting 
Python :: python string: built-in function len() 
Python :: if statement collection python 
Python :: Spatial Reference arcpy 
Python :: initials of name 
Python :: installing python3.8 in rpi 
Python :: PyQt5 change keyboard/tab behaviour in a table 
Python :: python download from digital ocean spaces boto3 
Python :: "%(class)s" in django 
Python :: import 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =