Ars*_*eep 4 php crc32 checksum
PHP的crc32支持字符串作为输入.对于一个文件,下面的代码将工作OFC.
crc32(file_get_contents("myfile.CSV"));
Run Code Online (Sandbox Code Playgroud)
但是如果文件变得很大(2 GB),它可能会引发内存不足致命错误.
所以任何方式找到大文件的校验和?
PHP不支持大于2GB的文件(32位限制)
从文件计算crc32的更有效方法:
$hash = hash_file('crc32b',"myfile.CSV" );
Run Code Online (Sandbox Code Playgroud)