Код: Выделить всё
import hashlib
import csv
from collections import OrderedDict
hp = OrderedDict()
akahr = OrderedDict()
def hash_password_hack(input_file_name, output_file_name):
with open(input_file_name) as fin :
reader = csv.reader(fin)
for i in range (0 , 10000):
x = repr(i).encode()
y = hashlib.sha256(x).hexdigest()
##print(y)
hp[y]= i
##print(hp)
for radif in reader :
name = radif[0]
hash = radif[1]
for hash_dakhele_hp in hp.keys():
if hash_dakhele_hp==hp.keys():
akahr[name]=hp.get(hash_dakhele_hp)
with open(output_file_name,'w') as out :
count = 0
for name in akahr :
count +=1
if count == 1:
out.write(name + ',' + str(akahr.get(name)))
else:
out.write('/n' + name + str(akahr.get(name)))
Код: Выделить всё
Danial,a19fbf8bf0530ca46179b803a8234f56276f21c0e7dc2f84c682924b95de5801
р>
Код: Выделить всё
Danial,1596
Подробнее здесь: https://stackoverflow.com/questions/787 ... n-function