md5_file is that “safe” comparison i php
-
24-12-2019 - |
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?
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