checksum.CRC32
The CRC-32 checksum calculation object.
Constructor
CRC32(poly: integer?, init: integer?, ref_in: boolean?, ref_out: boolean?, xor_out: integer?): checksum.CRC32Fields
| Name | Type | Description |
|---|---|---|
DigestSize | integer | The size of the checksum in bytes. = 4 |
Static functions
BZIP2 | The CRC-32 checksum class that uses BZIP2 algorithm parameters. |
C | The CRC-32 checksum class that uses Castagnoli/C algorithm parameters. |
D | The CRC-32 checksum class that uses D algorithm parameters. |
digest | Calculates the CRC-32 checksum of the specified string. |
JAMCRC | The CRC-32 checksum class that uses JamCRC algorithm parameters. |
MPEG2 | The CRC-32 checksum class that uses MPEG-2 algorithm parameters. |
POSIX | The CRC-32 checksum class that uses POSIX algorithm parameters. |
Q | The CRC-32 checksum class that uses Q algorithm parameters. |
XFER | The CRC-32 checksum class that uses XFER algorithm parameters. |
#CRC32.BZIP2
function CRC32.BZIP2(): checksum.CRC32
The CRC-32 checksum class that uses BZIP2 algorithm parameters.
Returns
| Type | Name | Description |
|---|---|---|
checksum.CRC32 | object |
#CRC32.C
function CRC32.C(): checksum.CRC32
The CRC-32 checksum class that uses Castagnoli/C algorithm parameters.
Returns
| Type | Name | Description |
|---|---|---|
checksum.CRC32 | object |
#CRC32.D
function CRC32.D(): checksum.CRC32
The CRC-32 checksum class that uses D algorithm parameters.
Returns
| Type | Name | Description |
|---|---|---|
checksum.CRC32 | object |
#CRC32.digest
function CRC32.digest(raw_str: string, poly?: integer, init?: integer, ref_in?: boolean, ref_out?: boolean, xor_out?: integer): integer
Calculates the CRC-32 checksum of the specified string.
Parameters
| Name | Type | Description |
|---|---|---|
raw_str | string | The string is used to calculate checksum. |
polyoptional | integer | The polynomial is used to calculate checksum. |
initoptional | integer | The initial value is used to calculate checksum. |
ref_inoptional | boolean | Whether to reflect the input data before processing. |
ref_outoptional | boolean | Whether to reflect the output data after processing. |
xor_outoptional | integer | The XOR value is used to calculate checksum. |
Returns
| Type | Name | Description |
|---|---|---|
integer | checksum | The CRC-32 checksum, which is greater or equal to 0, and less than 2^32 (0x100000000). |
#CRC32.JAMCRC
function CRC32.JAMCRC(): checksum.CRC32
The CRC-32 checksum class that uses JamCRC algorithm parameters.
Returns
| Type | Name | Description |
|---|---|---|
checksum.CRC32 | object |
#CRC32.MPEG2
function CRC32.MPEG2(): checksum.CRC32
The CRC-32 checksum class that uses MPEG-2 algorithm parameters.
Returns
| Type | Name | Description |
|---|---|---|
checksum.CRC32 | object |
#CRC32.POSIX
function CRC32.POSIX(): checksum.CRC32
The CRC-32 checksum class that uses POSIX algorithm parameters.
Returns
| Type | Name | Description |
|---|---|---|
checksum.CRC32 | object |
#CRC32.Q
function CRC32.Q(): checksum.CRC32
The CRC-32 checksum class that uses Q algorithm parameters.
Returns
| Type | Name | Description |
|---|---|---|
checksum.CRC32 | object |
#CRC32.XFER
function CRC32.XFER(): checksum.CRC32
The CRC-32 checksum class that uses XFER algorithm parameters.
Returns
| Type | Name | Description |
|---|---|---|
checksum.CRC32 | object |
Methods
digest | Finalizes checksum calculation and returns the resulting checksum. |
update | Updates checksum with the specified string. |
#CRC32:digest
function checksum.CRC32:digest(): integer
Finalizes checksum calculation and returns the resulting checksum.
Returns
| Type | Name | Description |
|---|---|---|
integer | checksum | The final checksum value, which is greater or equal to 0, and less than 2^32 (0x100000000). |
#CRC32:update
function checksum.CRC32:update(raw_str: string): checksum.CRC32
Updates checksum with the specified string.
Parameters
| Name | Type | Description |
|---|---|---|
raw_str | string | The string is used to update checksum. |
Returns
| Type | Name | Description |
|---|---|---|
checksum.CRC32 | self |