A
A
aresht2015-12-03 14:25:45
linux
aresht, 2015-12-03 14:25:45

Why is the file checksum different on different OS?

Good afternoon. Using the md5_file function in PHP, I get the checksum of the file, but I noticed that on Windows 7 x86 and OSX, the function gives me different hashes. How can this be and what is it connected with?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
GreatRash, 2015-12-03
@aresht

Windows and Linux has different line endings, \r\n and \n. So when the file is read, the content of files is different.

via

V
Vladimir Martyanov, 2015-12-03
@vilgeforce

First you need to understand whether the correct hash is issued at all. md5deep filename and compare with PHP results.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question