#!/usr/bin/python# -*- coding: utf8 -*-from datetime import datetime, timedeltanow = datetime.now() # current date and timenow_up = now - timedelta(days=5)now_up = now_up.strftime("%Y-%m-%dT%H:%M:%S+0
我们写程序中,经常需要对字符串进行MD5加密,python中也支持这种加密,下面说说,这个加密模块:hashlib。原则:只要你的输入是固定的,你的输出也一定是固定的。MD5是在hash上更改的,主要做文件的一致性1、md5加密bashimporthashlibm=hashlib.md5()创建一个MD5对象m.update(b"luo")在python3中需要是2进制的值,所以字符串前加bpri
Copyright © 2005-2024 51CTO.COM 版权所有 京ICP证060544号