CRC64 checksum file for PHP

I need to get a CRC64 checksum of files using PHP.

Using this code

file_put_contents('example.txt', 'just an example');

echo hash_file('crc32', 'example.txt');

I get a CRC32 checksum of "c8c429fe";

But I need to get the checksum using the CRC64 algorithm (

enter image description here)

I took it from here: http://en.wikipedia.org/wiki/Cyclic_redundancy_check

How can I implement this hash algorithm in PHP?

+4
source share
2 answers
+5
source

hash_file is just a shell that takes the result from file_get_contents ($ file) to the shell, so you can use any function instead of crc32.

crc64? , md5 sha , ,

$hash = hash_file("sha1", $file);

, crc64

function crc64($string){
    // your code here
}

$hash = hash_file("crc64", $file);
0

All Articles