Base Framework
Public Member Functions | Static Public Attributes | List of all members
Adler32 Class Reference

Adler-32. More...

#include <base/security/Adler32.h>

Inherits Object, and PushInterface.

Public Member Functions

 Adler32 () noexcept
 
MemorySize push (const uint8 *buffer, MemorySize size) noexcept
 
uint64 getTotalSize () const noexcept
 
uint32 getValue () const noexcept
 
void setValue (uint32 value) noexcept
 
- Public Member Functions inherited from PushInterface
virtual void flush ()
 
virtual bool pushBegin (uint64 totalSize)
 
virtual void pushEnd ()
 

Static Public Attributes

static const unsigned int BASE = 65521
 

Detailed Description

Adler-32.

Implementation of the Adler-32 checksum algorithm as specified by RFC 1950.

Should only be used for compatibility with legacy systems.

See also
CRC32
Version
1.0
Examples
testsuite/digest.cpp.

Constructor & Destructor Documentation

◆ Adler32()

Adler32::Adler32 ( )
noexcept

Initializes object.

Member Function Documentation

◆ getTotalSize()

uint64 Adler32::getTotalSize ( ) const
inlinenoexcept

Returns the total size of the original message.

◆ getValue()

uint32 Adler32::getValue ( ) const
inlinenoexcept

Returns the checksum.

Examples
testsuite/digest.cpp.

◆ push()

MemorySize Adler32::push ( const uint8 *  buffer,
MemorySize  size 
)
virtualnoexcept

Updates the checksum corresponding to the specified data. May be called multiple times.

Parameters
bufferThe buffer holding the data.
sizeThe number of octets in the buffer.

Implements PushInterface.

Examples
testsuite/digest.cpp.

◆ setValue()

void Adler32::setValue ( uint32  value)
inlinenoexcept

Sets the checksum.

Member Data Documentation

◆ BASE

const unsigned int Adler32::BASE = 65521
static

The largest prime smaller than 65536.