天天看點

python實作MD5加密

#-*- coding:utf-8 -*-
import hashlib

m= hashlib.md5()  #建立md5對象
m.update('abcdefg') #生成加密串,其中password是要加密的字元串
print m.hexdigest()  #列印經過md5加密的字元串

輸出結果:7ac66c0f148de9519b8bd264312c4d64