Boost logo

Boost Users :

From: Alex Henderson (Alex.Henderson_at_[hidden])
Date: 2003-06-09 11:48:00


Hi,

I'd like to calculate a value for a cyclic redundancy check (crc) for a
number of files.

This isn't going to be transmitted anywhere, I simply want to compare the
values to see whether the files are exactly the same. I know I can simply
check byte for byte, but I've got a few thousand files and it's easier to
calculate the crc for each and see whether any are the same first.

I've looked at the crc library, but can't get my head round the example. It
seems to test the library rather than show how its used.

I'm after something like

  std::vector<char> MyStream1; // the whole file (about 500kb)

  boost::SomeCRCTypeThatIsOptimisedForSafetyAndLargeishBlocks<???> x;

  long = x.checkme(MyStream1);

Could someone please point me to some code where a simple example is
detailed?

Thanks,
Alex


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net