惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Martin Fowler
Martin Fowler
博客园 - 【当耐特】
GbyAI
GbyAI
M
MIT News - Artificial intelligence
Microsoft Azure Blog
Microsoft Azure Blog
A
About on SuperTechFans
罗磊的独立博客
Apple Machine Learning Research
Apple Machine Learning Research
腾讯CDC
F
Fortinet All Blogs
IT之家
IT之家
WordPress大学
WordPress大学
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Last Week in AI
Last Week in AI
Google DeepMind News
Google DeepMind News
Jina AI
Jina AI
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
D
DataBreaches.Net
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
H
Help Net Security
V
Visual Studio Blog
小众软件
小众软件
Y
Y Combinator Blog

博客园 - 西康的博客

mysql information_schema库中COLUMNS 和 TABLES表字段详解 python - queue 队列模块 python - 修改系统环境变量 python - threading 多进程模块 python - socketserver python - 反射 python - socket 基础 python 序列化 字典 异常处理 类的成员,类的特殊方法 elasticsearch RESTfull _cat api python - 面向对象编程基础知识 (进阶) python - 面向对象编程基础知识 python 文件操作 python re 模块 正则表达式 python configparser 模块 python logging 模块 python sys 模块
python hashlib 模块
西康的博客 · 2018-03-25 · via 博客园 - 西康的博客

hashlib 是把明文加密成密文的模块。

import hashlib
# md5加密
md5 = hashlib.md5()
md5.update(b'test')
print (md5.hexdigest())

# sha1加密
sha1 = hashlib.sha1()
sha1.update(b'test')
print (sha1.hexdigest())

# sha256加密
sha256 = hashlib.sha256()
sha256.update(b'test')
print (sha1.hexdigest())

# sha512加密
sha512 = hashlib.sha512()
sha512.update(b'test')
print (sha1.hexdigest())

posted @ 2018-03-25 15:43  西康的博客  阅读(73)  评论(0)    收藏  举报