adler32

Compute the Adler-32 checksum of a buffer's worth of data.

uint
adler32
(
uint adler
,
const(void)[] buf
)

Parameters

adler uint

the starting checksum for the computation. Use 1 for a new checksum. Use the output of this function for a cumulative checksum.

buf const(void)[]

buffer containing input data

Return Value

Type: uint

A uint checksum for the provided input data and starting checksum

Examples

static ubyte[] data = [1,2,3,4,5,6,7,8,9,10];

uint adler = adler32(0u, data);
assert(adler == 0xdc0037);

See Also

Meta