30 lines
1.2 KiB
Python
30 lines
1.2 KiB
Python
import bcrypt
|
|
|
|
def hash_password(password):
|
|
salt = bcrypt.gensalt()
|
|
hashed_password = bcrypt.hashpw(password.encode('utf-8'), salt)
|
|
return hashed_password
|
|
def hesh():
|
|
while True:
|
|
password = input("Введите пароль для хеширования: ")
|
|
hashed_password = hash_password(password)
|
|
print(f"Хешированный пароль: {hashed_password.decode('utf-8')}")
|
|
|
|
import json
|
|
import itertools
|
|
|
|
hesh()
|
|
|
|
## Генерация всех возможных комбинаций чисел от 1 до 18
|
|
#combinations = list(itertools.permutations(range(1, 19)))
|
|
#
|
|
## Чтение существующего файла JSON
|
|
#with open('/home/jze9/Desktop/git-lab/copp/app/assets/test.json', 'r', encoding='utf-8') as file:
|
|
# data = json.load(file)
|
|
#
|
|
## Запись комбинаций в категорию Category
|
|
#data['Category'] = combinations
|
|
#
|
|
## Запись обновленного содержимого обратно в файл JSON
|
|
#with open('/home/jze9/Desktop/git-lab/copp/app/assets/test.json', 'w', encoding='utf-8') as file:
|
|
# json.dump(data, file, ensure_ascii=False, indent=4) |