code-dumps/py/myrandom.py

19 lines
626 B
Python
Raw Normal View History

#!/usr/bin/env python3
2024-02-22 15:37:33 +08:00
from typing import NoReturn
#from passlib.hash import sha512_crypt
from passlib.hash import pbkdf2_sha512
import string
2024-02-22 15:37:33 +08:00
#import crypt
import threading
from random import *
characters = string.ascii_letters + "~@#%^*()-_+=23456789"
2024-02-22 15:37:33 +08:00
def genOne() -> NoReturn:
password = "".join(choice(characters) for x in range(randint(12, 16)));
2024-02-22 15:37:33 +08:00
#salt = crypt.mksalt(method=crypt.METHOD_SHA512);
#print (password, "|", crypt.crypt(password,salt=salt));
print (password, "|", "$6$" + pbkdf2_sha512.hash(password).split('$')[-1]);
for i in range(4):
threading.Thread(target=genOne, args=()).start()