Skip to content
Sign upLog in
← Back to Community

Base64 Encoder and Decoder

Profile icon
Babbel

Hi guys!

Here's a Base64 Encoder and Decoder I created.

(Base64? Can you eat that?)

Since it's easy to use, I haven't written any examples. But if you don't know how to use it, feel free to ask me.

If there are any problems with the code, please report them in the comments!

Voters
Profile icon
Ganesha1
Profile icon
ash15khng
Profile icon
Corsaka
Profile icon
Babbel
Comments
hotnewtop
Profile icon
PYer

How did you manage to use the replit module? When I try it says that there is no replit module.

Profile icon
Babbel

@fullern000
i know that problem. For some reason, you can't use it in project mode

Profile icon
21natzil

You forgot to add the "=" to the end, not sure how important that is, but python's base64.b64encode does it.

Profile icon
Babbel

@21natzil
it isn't needed there, because the program gets them via index. 6 bit numbers go from 0 (A) to 63 (/). '=' would have the index 64, which means that it couldn't be used. But otherwise you would be right.

Profile icon
Corsaka

Never would've thought of using replit.clear() and a break. I personally use sys.exit(), but yours is a much cleaner and faster method. Take my updoot!

Profile icon
Babbel

@Corsaka
thank you very much! Didn't even know this is faster.