Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

base64.b32encode() in Python

  • Last Updated : 26 Mar, 2020

With the help of base64.b32encode() method, we can encode the string by using base32 alphabet into the binary form.

Syntax : base64.b32encode(string)

Return : Return the encoded string.

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




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

Output :

b’I5SWK23TIZXXER3FMVVXG===’

Example #2 :




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

Output :

b’JEQGY33WMUQHA6LUNBXW4===’

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!