How to use boost::crc?
Posted
by Andreas Bonini
on Stack Overflow
See other posts from Stack Overflow
or by Andreas Bonini
Published on 2010-04-04T06:06:12Z
Indexed on
2010/04/04
6:13 UTC
Read the original article
Hit count: 513
I want to use boost::crc so that it works exactly like PHP's crc32() function. I tried reading the horrible documentation and many headaches later I haven't made any progress.
Apparently I have to do something like:
int GetCrc32(const string& my_string) {
return crc_32 = boost::crc<bits, TruncPoly, InitRem, FinalXor,
ReflectIn, ReflectRem>(my_string.c_str(), my_string.length());
}
bits
should be 32.. What the other things are is a mystery. A little help? ;)
© Stack Overflow or respective owner