使用默认哈希和SHA256对字典进行哈希的简单Python工具。
dict-hash的Python项目详细描述
使用默认哈希和SHA256对字典进行哈希的简单Python工具。
如何安装此软件包?
像往常一样,只需使用pip:
pip install dict_hash
用法示例
该包提供两个函数:sha256生成常量sha256散列,以及dict_hash使用本机的散列函数生成散列。
dict_hash
fromdict_hashimportdict_hashfromrandom_dictimportrandom_dictfromrandomimportrandintd=random_dict(randint(1,10),randint(1,10))my_hash=dict_hash(d)
SHA256
fromdict_hashimportsha256fromrandom_dictimportrandom_dictfromrandomimportrandintd=random_dict(randint(1,10),randint(1,10))my_hash=sha256(d)