Friday, September 5, 2025
HomeLanguagesbase64.standard_b64encode(s) in Python

base64.standard_b64encode(s) in Python

With the help of base64.standard_b64encode(s) method, we can encode the string using standard base64 alphabets into the binary form.

Syntax : base64.standard_b64encode(s)

Return : Return the encoded string.

Example #1 :
In this example we can see that by using base64.standard_b64encode(s) method, we are able to get the encoded string which can be in binary form by using this method.




# import base64
from base64 import standard_b64encode
  
s = b'GeeksForGeeks'
# Using base64.standard_b64encode(s) method
gfg = standard_b64encode(s)
  
print(gfg)


Output :

b’R2Vla3NGb3JHZWVrcw==’

Example #2 :




# import base64
from base64 import standard_b64encode
  
s = b'I love python'
# Using base64.standard_b64encode(s) method
gfg = standard_b64encode(s)
  
print(gfg)


Output :

b’SSBsb3ZlIHB5dGhvbg==’

Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32264 POSTS0 COMMENTS
Milvus
81 POSTS0 COMMENTS
Nango Kala
6634 POSTS0 COMMENTS
Nicole Veronica
11801 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11861 POSTS0 COMMENTS
Shaida Kate Naidoo
6750 POSTS0 COMMENTS
Ted Musemwa
7025 POSTS0 COMMENTS
Thapelo Manthata
6698 POSTS0 COMMENTS
Umr Jansen
6718 POSTS0 COMMENTS