R
R
Russian Federation2015-12-04 14:09:24
Python
Russian Federation, 2015-12-04 14:09:24

What is the md5 comparison algorithm?

Good day!
There are many programs for comparing two files.
But what algorithm is used to compare two md5 hash functions.
There is no such method in hashlib (Python3).
Update: you need to find 2 maximally similar hashes.
Thank you.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
Duha666, 2015-12-04
@Duha666

Compare digest() against hashes

A
angru, 2015-12-04
@angru

uh md5('123').hexdigest() == md5('456').hexdigest()?

A
Alexey Cheremisin, 2015-12-04
@leahch

In theory, and with the correct MD5, the result of the hash calculation should correspond to the normal distribution law as much as possible.
In other words, MD5 hashes from two files with a one-bit difference should match each other, like a random sample of two white noise values.
In other words - two hashes from two different files correspond to each other, like two randomly taken values.
Even simpler - it's useless to compare MD5 hashes!

V
Vladimir Martyanov, 2015-12-04
@vilgeforce

You probably mean the results of the hash functions, and not the functions themselves? Then the answer is simple: byte-by-byte comparison of the results if there is a raw hash (that is, memcmp). Or character-by-character if the hash is a string (i.e. strcmp).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question