from hashlib import md5 from base64 import b64decode,b64encode def get_encrypt_password(password): # 加个end防止撞库 end = "PASSWORD" md = md5() md.update((password + end).encode('utf-8')) return md.hexdigest() def decode_b64_pwd(b64_pwd:str): return b64decode(b64_pwd.encode('utf-8')).decode('utf-8')