what us wrong with this code 🤔
import time import string import hashlib ready = False start = time.monotonic() chars = list(string.printable)[:95] base = len(chars) n = 0 hashmethod = 0 password = "" solved = False quit = "" while not ready: password = input("Enter a valid MD5 or SHA-1 hash: ") if len(password) == 32: ready = True elif len(password) == 40: ready = True hashmethod = 2 def numberToBase(n, b): digits = [] while n: digits.append(int(n % b)) n //= b return digits[::-1] if password == '': print('Your password is empty') solved = True while not solved: lst = numberToBase(n, base) word = ''.join([chars[x] for x in lst]) if hashmethod == 2: hashedGuess = hashlib.sha1(word.encode('utf-8')).hexdigest() else: hashedGuess = hashlib.md5(word.encode('utf-8')).hexdigest() if password == hashedGuess: solved = True print('-Stats-') print('Pass: ' + word) print('Attempts: ' + str(n)) print('time: ' + str((time.monotonic() - start)) + ' sec') while quit != "QUIT": quit = input('Type <QUIT> to quit: ').upper() else: n += 1