-4

I'm doing a coding challenge where you have to make a code that takes an input, encodes it, subtracts the last 16 characters, and repeats that process 50 times. it then says to take the truncated hash and enter into the website I did the challenge on. However, it says that I did it wrong and I don't know where I got it wrong. Any ideas?

import hashlib

str2hash = 'MjhjMmRmMTIzMWFlOWVkMA==' #input
result = hashlib.md5(str2hash.encode())
string_result = str(result.hexdigest())
print(string_result)

for x in range (50):
    result2 = string_result

    str2hash = result2
    result = hashlib.md5(str2hash.encode())
    string_result = str(result.hexdigest())
    print(string_result[:-16])

I tried doing the Challenge (which I apparently did wrong) and I have no idea were the problem is and what I did wrong.

  • Don’t post the same question repeatedly [how do I subtract 16 characters from the end of the output?](https://stackoverflow.com/questions/75569996/how-do-i-subtract-16-characters-from-the-end-of-the-output) – Abhijit Sarkar Feb 28 '23 at 03:50

0 Answers0