Hello! I ran into an inexplicable situation: there is a cycle that receives the word randomly, and then hashes it in md5 with the help of hashlib and writes it into the .tt file. It gets the words randomly, but for some reason the hash in the output file is the same, as if the same word is hashed. I do not understand why:
import random from hashlib import md5 import requests import time out = input (r'Укажите файл для сохраниния: ') out2 = open (out, 'w') slovar = ('q','w','e','r','t','y','u','i','o','p','a','s','d','f','g','h','j','k','l','z','x','c','v','b','n','m','1','2','3','4','5','6','7','8','9','0') for i in range (99): randomm = random.choice(slovar) + random.choice(slovar) + random.choice(slovar) + random.choice(slovar) randomm2 = md5(b'randomm').hexdigest() r = requests.get ('http://mysite.com/'+ str(randomm2)) out2.write (randomm2 + '+' + str(r.status_code) + '\n') time.sleep (1) out2.close
2f8703a73bc2e86bad9a6ddf4631ae43? Well, this is a hash from the wordrandomm, it is in yourmd5(b'randomm')and spelled out and you take a hash from it. Maybe you wantedmd5(randomm)instead? - andreymal''.join(random.choice(slovar) for _ in range(4))- andreymal