Python中進(jìn)行Base64編碼和解碼要用base64模塊,代碼示例:
#-*- coding: utf-8 -*-import base64str = 'VEVb'str64 = base64.b64encode(str)PRint str64 #Y25ibG9ncw==print base64.b64decode(str64) #VEVb
#Python 2.ximport hashlibprint hashlib.md5("whatever your string is").hexdigest()#Python 3.ximport hashlibprint(hashlib.md5("whatever your string is".encode('utf-8')).hexdigest())
新聞熱點(diǎn)
疑難解答
圖片精選