hash算法
import hashlib content = 'its so coll'.encode('utf8') o = hashlib.sha1() # 建立一個hash對象 o.update(content) hash_sixteen = o.hexdigest() # 16進制
content1 = 'its so coll'.encode('utf8') o1 = hashlib.sha1() # 建立一個hash對象 o1.update(content1) hash_sixteen1 = o1.hexdigest() # 16進制
hash_sixteen is hash_sixteen1 False
hash_sixteen == hash_sixteen1 True hash算法相同