php针对同一图像的不同哈希


php different hash for same image

我有两个相同的映像存储在两个不同的服务器(dropbox和我自己的)中。然而,我意识到

hash("md5",file_get_contents($image1))
hash("md5",file_get_contents($image2))

正在为这些相同的图像返回不同的哈希。如何确保它们都返回相同的字符串?

您是否考虑过使用md5_file?

md5_file($image1);
md5_file($image2);

http://www.php.net/manual/en/function.md5-file.php