引用hashlib类做MD5加密 import hashlib def md5_hash(data_string): #hash_object = hashlib.md5() #加言的方式,不易被解密 hash_object = hashlib.md5("加言".encode('utf-8')) result = hash_object.update(pwd_string,encode('utf-8')) return hash_object.hexdigest()