def generate_random_users(): PH = PasswordHelper() DB = DBHelper() for _ in range(0, 670): one_name = str(get_one_random_name(letters)) one_domain = str(get_one_random_domain(domains)) email = one_name + "@" + one_domain print(email) name = one_name pw = "123456" salt = PH.get_salt() hashed = PH.get_hash(pw.encode('utf-8') + salt) DB.add_user(email, name, salt, hashed)
from passwordhelper import PasswordHelper import sys PH = PasswordHelper() password = '******' salt = PH.get_salt() hashWithSalt = PH.get_hash(password.encode('utf-8') + salt) print("password = {0}".format(password)) print("salt = {0}".format(salt)) print("Hash with salt = {0}".format(hashWithSalt))