(Hopefully) Daily Coding Challenge #1 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 6

(Hopefully) Daily Coding Challenge #1

Because it's becoming a trend to make quizzes and challenges and stuff. Also because it might help you become better at coding. So my first challenge is to make a text to Base64 converter. If you don't know what Base64 is, go to Wikipedia or read my short explanation in the answer below. I already made one, here it is: https://code.sololearn.com/cuSmXYEVZIbg/?ref=app For increased difficulty, make it able to convert a string to and from Base64, having the user specify whether it should de- or encrypt.

12th Apr 2017, 4:19 PM
Supersebi3
Supersebi3 - avatar
7 Answers
14th Apr 2017, 9:12 PM
Illusive Man
Illusive Man - avatar
+ 13
I prefer challenges that I can do in my head... But I'll have to read up on this and I'll probably make one in C# Later on... maybe... idk
14th Apr 2017, 5:11 PM
Jafca
Jafca - avatar
+ 7
next challenge tomorrow (hopefully) will probably be a bit less complicated
14th Apr 2017, 10:19 PM
Supersebi3
Supersebi3 - avatar
+ 6
So basically you take the ascii values of the symbols in a string, convert them to bytes, put them togeter to a big list, split them into 6-digit binary numbers, if last number is too short add 0s to it, then convert those numbers back to decimal and turn them into symbols of the Base64 alphabet: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/ where A = 0, B = 1 etc. Put those together. If the length of the original string % 3 isn't 0, add as many = to the end of the output string as there are missing characters to make the length be dividable by 3 in the original string. Yes I know shitty explanation
12th Apr 2017, 4:21 PM
Supersebi3
Supersebi3 - avatar
+ 5
I wont make next challenge until someone does this one
13th Apr 2017, 7:41 AM
Supersebi3
Supersebi3 - avatar
+ 5
@Jafca this is a coding challenge, not a thinking challenge ;)
14th Apr 2017, 5:13 PM
Supersebi3
Supersebi3 - avatar
+ 5
@IllusiveMan nice!
14th Apr 2017, 9:14 PM
Supersebi3
Supersebi3 - avatar