In Wikipedia SHA-1 pseudocode, it's said:
Pre-processing: append the bit '1' to the message e.g. by adding 0x80 if message length is a multiple of 8 bits. append 0 ≤ k < 512 bits '0', such that the resulting message length in bits
So is it same with \x01
and x00\x01
?
Python example:
import hashlib
for s in ('01', '0001'):
m=hashlib.sha1()
m.update(s.decode('hex'))
print m.hexdigest()
>>>bf8b4530d8d246dd74ac53a13471bba17941dff7
>>>0e356ba505631fbf715758bed27d503f8b260e3a
It turns out not to be the same, why?