Typo in CRC32 data length

This commit is contained in:
DennisOSRM
2012-02-16 16:18:13 +01:00
parent 3c8cea2af6
commit ac41c3b06c
3 changed files with 5 additions and 2 deletions
+3 -1
View File
@@ -26,7 +26,7 @@ CRC32::CRC32() : crc(0) {
unsigned CRC32::SoftwareBasedCRC32(char *str, unsigned len, unsigned crc) {
boost::crc_optimal<32, 0x1EDC6F41, 0x0, 0x0, true, true> CRC32_Processor;
CRC32_Processor.process_bytes( str, 100000000);
CRC32_Processor.process_bytes( str, len);
return CRC32_Processor.checksum();
}
@@ -62,8 +62,10 @@ CRC32::CRC32CFunctionPtr CRC32::detectBestCRC32C() {
unsigned ecx = cpuid(1);
bool hasSSE42 = ecx & (1 << SSE42_BIT);
if (hasSSE42) {
std::cout << "sse based" << std::endl;
return &CRC32::SSEBasedCRC32; //crc32 hardware accelarated;
} else {
std::cout << "softbased" << std::endl;
return &CRC32::SoftwareBasedCRC32; //crc32cSlicingBy8;
}
}
+1
View File
@@ -22,6 +22,7 @@
#define CRC32_H_
#include <boost/crc.hpp> // for boost::crc_32_type
#include <iostream>
class CRC32 {
private: