Adler32
Object → Adler32
The Adler-32 checksum calculation object.
Constructor
Adler32(): Adler32Fields
| Name | Type | Description |
|---|---|---|
DigestSize | integer | The size of the checksum in bytes. = 4 |
BlockSize | integer | The block size in bytes. = 8 |
Static functions
#Adler32.digest
function Adler32.digest(raw_str: string): integer
Calculates the Adler-32 checksum of the specified string.
Parameters
| Name | Type | Description |
|---|---|---|
raw_str | string | The string is used to calculate checksum. |
Returns
| Type | Name | Description |
|---|---|---|
integer | checksum | The checksum value, which is greater or equal to 0, and less than 2^32 (0x100000000). |
Methods
digest | Finalizes checksum calculation and returns the resulting checksum. |
reset | Resets checksum to the initial value. |
update | Updates checksum with the specified string. |
#Adler32:digest
function Adler32: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). |
#Adler32:reset
function Adler32:reset(): Adler32
Resets checksum to the initial value.
Returns
| Type | Name | Description |
|---|---|---|
Adler32 | self |
#Adler32:update
function Adler32:update(raw_str: string): Adler32
Updates checksum with the specified string.
Parameters
| Name | Type | Description |
|---|---|---|
raw_str | string | The string is used to update checksum. |
Returns
| Type | Name | Description |
|---|---|---|
Adler32 | self |