code-dumps/py/myrandom.py

19 lines
626 B
Python
Raw Normal View History

2024-10-24 23:09:21 +08:00
#!/usr/bin/env python3
from typing import NoReturn
#from passlib.hash import sha512_crypt
from passlib.hash import pbkdf2_sha512
import string
#import crypt
import threading
from random import *
characters = string.ascii_letters + "~@#%^*()-_+=23456789"
def genOne() -> NoReturn:
password = "".join(choice(characters) for x in range(randint(12, 16)));
#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()