onekey-depoly / sucode.py
dong625's picture
Update sucode.py
123479c verified
raw
history blame contribute delete
551 Bytes
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