Is Unix md5 different to python's hashlib.md5? -


i run echo lol | md5 in mac terminal , returns: 59bcc3ad6775562f845953cf01624225

but run print hashlib.md5("lol").hexdigest() in python 2.7 , get: 9cdfb439c7876e703e307864c9167a15

what doing wrong?

echo appends newline @ end default, give different hash.

in python, newline ending

>>> print hashlib.md5("lol\n").hexdigest() 59bcc3ad6775562f845953cf01624225 

standard echo command, newline ending omitted.

$ echo -n lol | md5sum - 9cdfb439c7876e703e307864c9167a15  - 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -