1. 程式人生 > >python-hashlib模塊

python-hashlib模塊

HA encode upd hash obj hashlib iges IV date

import hashlib
obj = hashlib.md5() #或者加嚴:obj = hashlib.md5(‘asdf‘.encode("utf8"))
obj.update(‘123456‘.encode("utf8")) #encode()用於字符串轉換字節
print(obj.hexdigest()) #生成固定32位長度碼(用於密碼存儲)


python-hashlib模塊