Jump to content

help on md5_file


syed

Recommended Posts

Hi guys I need some help, I would greatly appreciate it. I am trying to generate the md5 hash for a file. using the following code,

[code]print md5_file('test.txt'); [/code]

I am under the impression that the md5 hash is generated based on the contents of the file and not the filename is this correct? Either way  if I change the contents of test.txt I am still given the same md5 hash value. I am writing a comparision script to check if a file has been modified, but I am stuck on this part.

Also i zipped test.txt and saved it as 2 copies one test1.zip and the other test2.zip, but the contents of each zip were identical but i got 2 different hash values, which lead me to believe that md5_file function only works on the filename and not the file contents, can some one plz help me out and clarify things for me.
Link to comment
https://forums.phpfreaks.com/topic/32430-help-on-md5_file/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.