BIDS / sha256

Fast SHA256 in Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

null-byte corrupt hash

Telariust opened this issue · comments

detect null-byte problem, try

import hashlib
from c_sha256 import sha256 as c_sha256
str_bytes=b'123' + b'\x00' + b'456'
print('[hashlib] {}'.format(hashlib.sha256(str_bytes).digest().hex()))
print('[c_sha256] {}'.format(c_sha256.sha256(str_bytes).hex()))