Share your repls and programming experiences

← Back to all posts
Base64 Encoder and Decoder
Babbel (65)

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!

PYer (4010)

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

Babbel (65)

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

21natzil (1199)

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

Babbel (65)

@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.

Corsaka (0)

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!

Babbel (65)

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