-
首页
-
C4D R23.110 C++ SDK
#include <crc32c.h>
详细描述
This class implements a CRC32C generator which is based on the generator polynom x^32+x^28+x^27+x^26+x^25+x^23+x^22+x^20+x^19+x^18+x^14+x^13+x^11+x^10+x^9+x^8+x^6+1 0x11EDC6F41 (the iSCSI CRC). If available the SSE4.2 instructions are used, otherwise it will be calculated by software. The returned CRC value is equal for all machines. All these examples should deliver the same result per line (0xcdee067a) on all systems: UpdateUInt64(0x1234567890abcdef) UpdateUInt32(0x90abcdef) UpdateUInt32(0x12345678) UpdateUInt16(0xcdef) UpdateUInt32(0x567890ab) UpdateUInt16(0x1234) UpdateUChar(0xef) UpdateUChar(0xcd) UpdateUInt32(0x567890ab) UpdateUChar(0x34) UpdateUChar(0x12) UInt64 val = 0x1234567890abcdef Update(&val, 8) see
http://drdobbs.com/cpp/229401411
and
http://download.intel.com/design/intarch/papers/323405.pdf
for a parallelized CRC
构造函数 & 析构函数文档编制
◆
Crc32C()
[1/2]
Constructs the object and resets its state.
◆
Crc32C()
[2/2]
Constructs the object and sets its state to a certain value.
-
参数
-
[in]
|
u
|
The initial value.
|
成员函数文档编制
◆
GetCrc()
Gets the CRC value.
-
返回
-
The CRC value.
◆
Reset()
Resets the state of this instance.
◆
Set()
Constructs the objects and resets its state.
-
参数
-
[in]
|
u
|
The new state value.
|
◆
operator=()
Assigns another value.
-
参数
-
[in]
|
other
|
The new value.
|
-
返回
-
A reference to itself.
◆
GetResetValue()
static constexpr
UInt32
GetResetValue
|
(
|
|
)
|
|
|
static
constexpr
|
Gets the internal value of a reset class.
-
返回
-
The reset value.
◆
UpdateUInt64()
Accumulates the CRC value.
-
参数
-
[in]
|
u
|
The value used to accumulate the CRC value.
|
◆
UpdateUInt32()
Accumulates the CRC value.
-
参数
-
[in]
|
u
|
The value used to accumulate the CRC value.
|
◆
UpdateUInt16()
Accumulates the CRC value.
-
参数
-
[in]
|
u
|
The value used to accumulate the CRC value.
|
◆
UpdateUChar()
Accumulates the CRC value.
-
参数
-
[in]
|
u
|
The value used to accumulate the CRC value.
|
◆
Update()
[1/2]
Accumulates the CRC value.
-
参数
-
[in]
|
mem
|
A raw memory buffer.
|
◆
Update()
[2/2]
Accumulates the CRC value.
-
Template Parameters
-
ALIGNMENT
|
Alignment hint. Must be a power of 2.
|
-
参数
-
[in]
|
mem
|
A raw memory buffer.
|
◆
UpdateUInt()
Accumulates the CRC value.
-
参数
-
[in]
|
u
|
The value used to accumulate the CRC value.
|
◆
UpdateInt64()
Accumulates the CRC value.
-
参数
-
[in]
|
i
|
The value used to accumulate the CRC value.
|
◆
UpdateInt32()
Accumulates the CRC value.
-
参数
-
[in]
|
i
|
The value used to accumulate the CRC value.
|
◆
UpdateInt16()
Accumulates the CRC value.
-
参数
-
[in]
|
i
|
The value used to accumulate the CRC value.
|
◆
UpdateInt()
Accumulates the CRC value.
-
参数
-
[in]
|
i
|
The value used to accumulate the CRC value.
|
◆
UpdateChar()
Accumulates the CRC value.
-
参数
-
[in]
|
i
|
The value used to accumulate the CRC value.
|
◆
UpdateBool()
Accumulates the CRC value.
-
参数
-
[in]
|
b
|
The value used to accumulate the CRC value.
|
◆
UpdateFloat32()
Accumulates the CRC value.
-
参数
-
[in]
|
r
|
The value used to accumulate the CRC value.
|
◆
UpdateFloat64()
Accumulates the CRC value.
-
参数
-
[in]
|
r
|
The value used to accumulate the CRC value.
|
◆
UpdateFloat()
Accumulates the CRC value.
-
参数
-
[in]
|
r
|
The value used to accumulate the CRC value.
|
◆
UpdateVector2d32()
Accumulates the CRC value.
-
参数
-
[in]
|
r
|
The value used to accumulate the CRC value.
|
◆
UpdateVector32()
Accumulates the CRC value.
-
参数
-
[in]
|
r
|
The value used to accumulate the CRC value.
|
◆
UpdateVector4d32()
Accumulates the CRC value.
-
参数
-
[in]
|
r
|
The value used to accumulate the CRC value.
|
◆
UpdateVector2d64()
Accumulates the CRC value.
-
参数
-
[in]
|
r
|
The value used to accumulate the CRC value.
|
◆
UpdateVector64()
Accumulates the CRC value.
-
参数
-
[in]
|
r
|
The value used to accumulate the CRC value.
|
◆
UpdateVector4d64()
Accumulates the CRC value.
-
参数
-
[in]
|
r
|
The value used to accumulate the CRC value.
|
◆
UpdateVector2d()
Accumulates the CRC value.
-
参数
-
[in]
|
r
|
The value used to accumulate the CRC value.
|
◆
UpdateVector()
Accumulates the CRC value.
-
参数
-
[in]
|
r
|
The value used to accumulate the CRC value.
|
◆
UpdateVector4d()
Accumulates the CRC value.
-
参数
-
[in]
|
r
|
The value used to accumulate the CRC value.
|
◆
UpdatePointer()
Accumulates the CRC value.
-
参数
-
[in]
|
p
|
The value used to accumulate the CRC value.
|
Friends And Related Function Documentation
◆
operator==
Checks for equality.
-
参数
-
[in]
|
a
|
First operand.
|
[in]
|
b
|
Second operand.
|
-
返回
-
True, if both are equal.
◆
operator!=
Checks for inequality.
-
参数
-
[in]
|
a
|
First operand.
|
[in]
|
b
|
Second operand.
|
-
返回
-
True, if both are equal.
Member Data Documentation
◆
_crc
The CRC value that is accumulated.
◆
crc32tab_o32
const
UInt32
crc32tab_o32[256]
|
|
static
protected
|
A helper table for the software CRC.
◆
crc32tab_o40
const
UInt32
crc32tab_o40[256]
|
|
static
protected
|
◆
crc32tab_o48
const
UInt32
crc32tab_o48[256]
|
|
static
protected
|
◆
crc32tab_o56
const
UInt32
crc32tab_o56[256]
|
|
static
protected
|
◆
crc32tab_o64
const
UInt32
crc32tab_o64[256]
|
|
static
protected
|
◆
crc32tab_o72
const
UInt32
crc32tab_o72[256]
|
|
static
protected
|
◆
crc32tab_o80
const
UInt32
crc32tab_o80[256]
|
|
static
protected
|
◆
crc32tab_o88
const
UInt32
crc32tab_o88[256]
|
|
static
protected
|
◆
RESET_VALUE
◆
UNSET_VALUE
const
UInt32
UNSET_VALUE
static
|
|
Crc is most liekly unset if GetCrc returns UNSET_VALUE.