相关疑难解决方法(0)

哈希字典?

出于缓存目的,我需要从dict中存在的GET参数生成缓存键.

目前我正在使用sha1(repr(sorted(my_dict.items())))(sha1()是一种在内部使用hashlib的便捷方法),但我很好奇是否有更好的方法.

python hash dictionary

135
推荐指数
9
解决办法
8万
查看次数

标签 统计

dictionary ×1

hash ×1

python ×1