Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is the same input returning two different MD5 hashes?

Tags:

php

md5

Alright, I have two files. They are the EXACT SAME.

The first file is: http://iadsonline.com/servconfig.php

And the second file is: http://xzerox.info/servconfig.php

However, when I use md5_file() to get their MD5, They return two different MD5's.

The first returns cc7819055cde3194bb3b136bad5cf58d, which is incorrect, and the second returns 96a0cec80eb773687ca28840ecc67ca1, which is correct.

The file is simply an  

To verify, I've used this code:

$contents = file_get_contents($URL);
echo htmlentities($contents);

And they both return  

So why is it hashing them differently?

like image 371
Rob Avatar asked Dec 29 '22 17:12

Rob


1 Answers

The second one ends in a newline, the first does not.

like image 60
Matthew Flaschen Avatar answered Dec 31 '22 07:12

Matthew Flaschen