identify checksum type?

Christian Heimes lists at
Mon Jun 29 19:54:16 EDT 2009

PK schrieb:
> Given a checksum value, whats the best way to find out what type it is?
> meaning. I can use hashlib module and compute a md5 or sha1 for a given data
> etc..but given a checksum value say "d2bda52ee39249acc55a75a0f3566105" whats
> the best way for me to identify if its a sha1 or md5 or anyother sum type
> for that matter?
> is there a nice way to do this in python?

As far as I know there is no way to identify a checksum by its value. A
checksum is just a number. You can try an educated guess based on the
length of the checksum. Or you can try all hash algorithms until you get
a hit but that may lead to security issues.

Some applications prefix the hash value with an identifier like "{MD5}"
or "{SHA1}".


More information about the Python-list mailing list