python中sha1 md5等用法

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_31340657/article/details/80341649
import hashlib
sha1 = hashlib.sha1()
    sha1.update('a'.encode('utf-8'))
    sha1.update('b'.encode('utf-8'))
    sha1.update('c'.encode('utf-8'))
    等同于:
    sha1.update('abc'.encode('utf-8'))
hashcode = sha1.hexdigest() #获取加密串

md5 用法基本相同
微信公众号提供的map(sha1.update,list)方法错误,不能使用(不开放公众号,没看过说明文档的请忽略)

猜你喜欢

转载自blog.csdn.net/qq_31340657/article/details/80341649