1. Go to this page and download the library: Download awesome/crc_fast library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
// calculate the checksum of a string
$checksum = CrcFast\hash(
algorithm: CrcFast\CRC_64_NVME,
string: '123456789'
); // ae8b14860a799888
// calculate the checksum of a file, which will chunk through the file optimally,
// limiting RAM usage and maximizing throughput
$checksum = CrcFast\hash_file(
algorithm: CrcFast\CRC_64_NVME,
filename: 'path/to/123456789.txt',
); // ae8b14860a799888
$crc64Digest = CrcFast\Digest::new(
algorithm: CrcFast\CRC_64_NVME,
);
// write some data to the digest
$crc64Digest->write('1234');
// write some more data to the digest
$crc64Digest->write('56789');
// calculate the entire digest
$checksum = $crc64Digest->finalize(); // ae8b14860a799888