Get MD5 Checksum for Very Large Files

前端 未结 5 2094
情歌与酒
情歌与酒 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:12

    Make sure to use escapeshellarg ( http://us3.php.net/manual/en/function.escapeshellarg.php ) if you decide to use a shell_exec() or system() call. I.e.,

    shell_exec('md5sum -b ' . escapeshellarg($filename));
    

提交回复
热议问题