用hashlib.sha1()计算sha1值
返回ans = h.digest()
type(ans)是'str'
len(ans)是20
ans本质上是一个160bit的大数
此时需要对不同的ans值进行xor或者取对数运算
请问有什么办法吗?
PHPz2017-04-17 14:45:56
You can take out each character in ans, use ord to get its int value, and then perform operations such as xor or logarithm
ord('a') == 97
chr(97) == 'a'