string this-> MD5File(string [filename], int [buffer len to fread])

(Caronte Pcode version 2.0)

Description

string this-> MD5File( string [filename], int [buffer len for fread]);

Calculates the MD5 hash of file using the RSA Data Security, Inc. MD5 Message-Digest Algorithm, and returns that hash.
The hash is a 32-character hexadecimal number.
Pay attention to collisions.

The buffer len is in byte. (min size = 1 , max size 1048576)
It is possible to define a lenght of the buffer to speed up the Hash in huge files:

while(....) {
int read = fread(file ,buffer,bufferlen);
if (read <= 0)
break;
.....
}

Example.

Source:

CS_ANTISPAM_SCRIPT this = new CS_ANTISPAM_SCRIPT($_this);

this->Print(this->MD5File("F:\\sorgenti\\caronteantispam\\2.0\\Release\\CaronteAntispamKrn.exe",4096));




Out:

517d48b216910040e862296b1897d042