提交註冊用戶數據後出來這個,錯誤原因是update()必須指定要加密的字符串的字符編碼
s1 = sha1() s1.update(upwd.encode("utf8")) # 指定編碼格式,否則會報錯 upwd3 = s1.hexdigest()