View Single Post
Cpp Cpp's Avatar

JCF Member

Joined: Mar 2001

Posts: 1,557

Cpp is doing well so far

May 6, 2009, 10:15 AM
Cpp is offline
Reply With Quote
Quote:
Originally Posted by Unknown Rabbit View Post
Can anyone answer my question? Please? Or do I just need to go learn a new programming language for one simple task?
This snippet is taken from the zlib manual.

Quote:
uLong crc32 (uLong crc, const Bytef *buf, uInt len);
Update a running crc with the bytes buf[0..len-1] and return the updated crc. If buf is NULL, this function returns the required initial value for the crc. Pre- and post-conditioning (one's complement) is performed within this function so it shouldn't be done by the application. Usage example:
Code:
         uLong crc = crc32(0L, Z_NULL, 0);

         while (read_buffer(buffer, length) != EOF) {
           crc = crc32(crc, buffer, length);
         }
         if (crc != original_crc) error();
Also, have you taken a look at the C++ source code I posted a few replies earlier?

Quote:
Originally Posted by Unknown Rabbit View Post
Another question (though the first remains open), has anyone tried zlibbing the blocks with compression rates other than that which JCS uses? Can JJ2 still read them?
Yes, it can.
__________________
<a href="http://nmap.org/"><img border="0" alt="Nmap Security Scanner" src="http://images.insecure.org/nmap/images/prop/nmap_bnr_matrix_pfos.gif"/></a>