hash = hashlib.md5(b"str")  #md5对象,md5不能反解,可加参数

 

hash.update(b"str")  #对字符串进行加密

 

hash.hexdigest()  #拿到加密后的字符串