The PHP’s crc32 support string as input.And For a file , below code will work OFC.
crc32(file_get_contents("myfile.CSV"));
But if file goes huge (2 GB) it might raise out of memory Fatal error.
So any way around to find checksum of huge files ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This function in the User Contributed Notes to
crc32()claims to calculate the value without loading the file in full. If it works correctly, it should eliminate any memory problems.For a file larger than 2 GB, it is however likely to stop at the same 32-bit limitation you are encountering right now.
If possible, I would invoke an external tool that can calculate the checksum for files as large as the one at hand.