+ 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.
7 Antworten
+ 24
@Supersebi3 Here is mine:
https://code.sololearn.com/c7uniCELAzf6/?ref=app
+ 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
+ 7
next challenge tomorrow (hopefully)
will probably be a bit less complicated
+ 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
+ 5
I wont make next challenge until someone does this one
+ 5
@Jafca this is a coding challenge, not a thinking challenge ;)
+ 5
@IllusiveMan nice!