Checker Problem Base-32 Encoding task 206

Back to Problem Solutions forum

Igor Shapovalov     2020-11-12 02:23:00

"Source message should be at first "padded" with one or more symbols so that its total length is a multiple of 5."

For example "dashiki aspirin" checker encode like MRQXG2DJNNUSAYLTOBUXE2LOGU2TKNJV, that decodes like dashiki aspirin55555.

I had to break my code for pass this task :D

Is it problem with checker, isn't it?

qwerty     2020-11-12 02:41:55

The checker is right. As you just said, source message should be at first "padded" with one or more symbols so that its total length is a multiple of 5.

So we add 5 chraracters to 15-length string and get a string of length 20. 20 is multiple of 5. The checker is perfectly right.

I really have no idea why you unhappy with checker.

qwerty     2020-11-12 02:47:16

I'm on this site for quite a lot time, and believe me, in 1% cases there is a problem with checker, and in the remaining 99% cases there is a problem with people's heads. Always check yourself before blaming the checker.

Maybe you did think that string should not be padded at all? But problem statement is clear enough: "one or more symbols" is not "zero or more symbols". And... try to write a decoder for case if "55555" is not added. You will see that adding "55555" makes decoding process much easier.

Igor Shapovalov     2020-11-12 03:53:35

Oh, I thought that i don't had to add if its equal 5 without adding, okay, thank you) But about my decoder there isn't difference for is there some number at the end or not)

qwerty     2020-11-12 07:40:03

Yeah, sorry, you are right. I read problem statement again, and it states that input contain only normal text, so no tricky cases like test6 encoded.

Please login and solve 5 problems to be able to post at forum