Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Functions
adler32.h File Reference
#include <wireshark.h>

Go to the source code of this file.

Functions

WS_DLL_PUBLIC uint32_t update_adler32 (uint32_t adler, const uint8_t *buf, size_t len)
 Updates an existing Adler-32 checksum with new data.
 
WS_DLL_PUBLIC uint32_t adler32_bytes (const uint8_t *buf, size_t len)
 Computes the Adler-32 checksum of a byte array.
 
WS_DLL_PUBLIC uint32_t adler32_str (const char *buf)
 Computes the Adler-32 checksum of a C string.
 

Detailed Description

Compute the Adler32 checksum (RFC 1950) 2003 Tomas Kukosa

Wireshark - Network traffic analyzer By Gerald Combs geral.nosp@m.d@wi.nosp@m.resha.nosp@m.rk.o.nosp@m.rg Copyright 1998 Gerald Combs

SPDX-License-Identifier: GPL-2.0-or-later

Function Documentation

◆ adler32_bytes()

WS_DLL_PUBLIC uint32_t adler32_bytes ( const uint8_t *  buf,
size_t  len 
)

Computes the Adler-32 checksum of a byte array.

Calculates the Adler-32 checksum for the entire buffer in one pass.

Parameters
bufPointer to the byte array.
lenLength of the array in bytes.
Returns
Adler-32 checksum of the buffer.

◆ adler32_str()

WS_DLL_PUBLIC uint32_t adler32_str ( const char *  buf)

Computes the Adler-32 checksum of a C string.

Calculates the Adler-32 checksum for a NUL-terminated string.

Parameters
bufPointer to the input string.
Returns
Adler-32 checksum of the string.

◆ update_adler32()

WS_DLL_PUBLIC uint32_t update_adler32 ( uint32_t  adler,
const uint8_t *  buf,
size_t  len 
)

Updates an existing Adler-32 checksum with new data.

Computes the Adler-32 checksum of the given buffer and updates the provided checksum value. This allows incremental checksum computation across multiple buffers.

Parameters
adlerThe current Adler-32 checksum value.
bufPointer to the data buffer.
lenLength of the buffer in bytes.
Returns
Updated Adler-32 checksum.