dreamworkAPI
Ctrl K
GitHub
classDocs / Fletcher16

Fletcher16

classsharedmenusource
Object → Fletcher16

The Fletcher-16 checksum calculation object.

Constructor

Fletcher16(): Fletcher16

Fields

NameTypeDescription
DigestSizeintegerThe size of the checksum in bytes. = 2

Static functions

#Fletcher16.digest

sharedmenunodiscardsource
function Fletcher16.digest(raw_str: string): integer

Calculates the Fletcher-16 checksum of the specified string.

Parameters
NameTypeDescription
raw_strstringThe string is used to calculate checksum.
Returns
TypeNameDescription
integerchecksumThe checksum value, which is greater or equal to 0, and less than 2^16 (0x10000).

Methods

digestFinalizes checksum calculation and returns the resulting checksum.
resetResets checksum to the initial value.
updateUpdates checksum with the specified string.

#Fletcher16:digest

sharedmenunodiscardsource
function Fletcher16:digest(): integer

Finalizes checksum calculation and returns the resulting checksum.

Returns
TypeNameDescription
integerchecksumThe final checksum value, which is greater or equal to 0, and less than 2^16 (0x10000).

#Fletcher16:reset

sharedmenusource
function Fletcher16:reset(): Fletcher16

Resets checksum to the initial value.

Returns
TypeNameDescription
Fletcher16self

#Fletcher16:update

sharedmenusource
function Fletcher16:update(raw_str: string): Fletcher16

Updates checksum with the specified string.

Parameters
NameTypeDescription
raw_strstringThe string is used to update checksum.
Returns
TypeNameDescription
Fletcher16self

Subclasses

Fletcher32

Generated from the dreamwork meta branch.