一、Python Base64编码Python中进行Base64编码和解码要用base64模块,代码示例:
#-*- coding: utf-8 -*-importbase64
str='cnblogs'str64=base64.b64encode(str)PRintstr64#Y25ibG9ncw==printbase64.b64decode(str64)#cnblogs
二、md5#Python 2.ximporthashlibprinthashlib.md5("whatever your string is").hexdigest()#Python 3.ximporthashlibprint(hashlib.md5("whatever your string is".encode('utf-8')).hexdigest())