In my program I have to calculate the Adler32 checksum of a file, but I've a problem in using this algorithm.
The function prototype is:
unsigned long adler32(unsigned long adler, const char *buf, unsigned int len);
I know how to calculate the Adler32 checksum of a string, but in this prototype data are "unsigned long" and there are also a buffer and a length. How can I calculate the checksum of a generic file with this function? And the buffer or the length?
FILE *fp; fp = fopen("file.txt", "r"); //--> ???
Thanks in advance!
Edited by Simone Z.