compress.checksum
import compress
compressexposes this ascompress.checksum, soimport compressis enough and the names are called ascompress.checksum.*.import compress.checksumreaches the same definitions directly.
This is the checksum submodule for the compress module.
Functions
adler32()
compress.checksum.adler32(data, initial) -> number
Updates a running Adler-32 checksum with the bytes buf[0,len-1] and return the updated checksum.
Parameters
data(bytes|string)initial(?number) — Default1: the algorithm’s own defined identity/seed value (RFC 1950). Pass the previously returned checksum here to continue an incremental computation across multiple calls.
Returns number
Note: An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed much faster.
crc32()
compress.checksum.crc32(data, initial) -> number
Update a running CRC-32 checksum with the bytes buf[0,len-1] and return the updated CRC-32 checksum.
Parameters
data(bytes|string)initial(?number) — Default0: the algorithm’s own defined identity/seed value. Pass the previously returned checksum here to continue an incremental computation across multiple calls.
Returns number
2021, Richard Ore and Zuri contributors