如何使用 python 計算 binary sha1.
str 中可以包含 binary data
>>> import hashlib >>> b = "this is binary \x0f\x0b\x0c" 'this is binary \x0f\x0b\x0c' >>>
'275ef095712a186a6400746efdd4d0e9b51e7874'
hashlib.sha1(b.encode('utf-8')).hexdigest()
如何使用 python 計算 binary sha1.
str 中可以包含 binary data
>>> import hashlib >>> b = "this is binary \x0f\x0b\x0c" 'this is binary \x0f\x0b\x0c' >>>
'275ef095712a186a6400746efdd4d0e9b51e7874'
hashlib.sha1(b.encode('utf-8')).hexdigest()