import hashlib | |
import pytz | |
from datetime import datetime | |
def su(username): | |
tz = pytz.timezone('Asia/Shanghai') | |
current_time_day = datetime.now(tz).strftime('%Y%m%d') | |
services = ["webui", "forge", "forgeflux","comfyui", "comfyuiflux", "fooocus", "facefusion"] | |
passwords = {} | |
for service in services: | |
password_str = f"{username}{current_time_day}{service}" | |
password = f"{service}-{hashlib.sha256(password_str.encode()).hexdigest()[2:8]}" | |
passwords[service] = password | |
return passwords | |