Epok Engine

PSYQO SDK

psyqo::adler32_bytes

Function · 1 overload

Function

Computes the adler32 checksum of a buffer, only reading bytes.

Belongs to
psyqo
Header
adler32.hh
Overloads
1

Declaration

Declaration
uint32_t adler32_bytes(uint8_t* buffer, unsigned length, uint32_t sum = 1)

Computes the adler32 checksum of a buffer, only reading bytes.

ParameterTypeMeaning
bufferuint8_t *The buffer to checksum.
lengthunsigned intValue supplied for length. Keep referenced or pointed-to data valid for the complete call.
sumuint32_tThe previous sum to continue the checksum for.

Returns: uint32_t — The adler32 checksum of the buffer.

Example

C++ example
#include "psyqo/adler32.hh"

// Assume these named values have been initialized with valid data:
// uint8_t * buffer
// unsigned int length
// uint32_t sum

auto result = psyqo::adler32_bytes(buffer, length, sum);

Why use it

It provides direct, allocation-conscious access to the adler32 module. No exception-based error path is implied by the signature.

Trade-offs and warnings

Pointer/reference arguments are borrowed unless the source contract says otherwise; keep them valid for the complete operation and never assume null is accepted.

Declared in https://github.com/pcsx-redux/nugget/blob/6186b131aacc5853a9161fb076ed34ffe504552d/psyqo/adler32.hh:66

Related members