python两种生成md5的方法
2016-05-31 14:50
495 查看
一. 使用md5包
二. 使用hashlib
推荐使用第二种方法。
import md5 src = 'this is a md5 test.' m1 = md5.new() m1.update(src) print m1.hexdigest()
二. 使用hashlib
import hashlib m2 = hashlib.md5() m2.update(src) print m2.hexdigest()
推荐使用第二种方法。
相关文章推荐
- Python 通过Jpype调用Java类
- 《Python基础教程》学习笔记 Chp6 抽象
- Python反转
- 边做边学Python Flask Web开发(1)-- 安装Python
- Python操作Excel之xlwt
- Python爬虫
- Python操作Excel之xlrd
- 0622 python 基础05
- python06-切片、列表生成器
- 0617 python 基础04
- 0610 python 基础03
- python启动应用程序和终止应用程序
- python数据保存
- python 装饰器
- Python 3.4.3 使用threading模块进行多线程编码实现
- python官方文档
- python官方文档
- logistic回归和Python实现
- python编辑器对比和推荐
- python编辑器对比和推荐