Get MD5 Checksum for Very Large Files

前端 未结 5 2038
情歌与酒
情歌与酒 2021-01-18 01:27

I\'ve written a script that reads through all files in a directory and returns md5 hash for each file. However, it renders nothing for a rather large file. I assume that t

5条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-18 02:17

    While i couldn't reproduce it with PHP 5.2 or 5.3 with a 2GB file the issue seems to come up on 32bit PHP builds.

    Even so it's not a really nice solution you could try to let the system to the hasing

    echo system("md5sum test.txt");
    

    46d6a7bcbcf7ae0501da341cb3bae27c test.txt

提交回复
热议问题