标签:
1 #-*- coding:utf-8 -*- 2 3 import md5 4 5 def Str2Md5(s): 6 m=md5.new() 7 m.update(s) 8 return m.hexdigest() 9 10 if __name__=="__main__": 11 s="www.baidu.com" 12 print Str2Md5(s)
1 #-*- coding:utf-8 -*- 2 3 import hashlib 4 5 def Str2Md5(s): 6 m=hashlib.md5() 7 m.update(s) 8 return m.hexdigest() 9 10 if __name__=="__main__": 11 s="www.baidu.com" 12 print Str2Md5(s)
标签:
原文地址:http://www.cnblogs.com/acode/p/4557351.html