Question

I am about to build a simple document system in php. I would like to know if "md5_file()" is "safe" comparison for all filetypes.

I don't know all filetypes in the system. But I need to be able to compare all types.

Is there any alternatives?

Was it helpful?

Solution

For functions like md5_file(), sha_file() it does not matter what the actual content (or filetype) of the file is.

OTHER TIPS

sha1_file is an arguably "safer" calculation, but will also be slower.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top