ckb-next  v0.2.8 at branch master
ckb-next driver for corsair devices
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
QuaAdler32 Class Reference

Adler32 checksum. More...

#include <quazip/quaadler32.h>

+ Inheritance diagram for QuaAdler32:
+ Collaboration diagram for QuaAdler32:

Public Member Functions

 QuaAdler32 ()
 
quint32 calculate (const QByteArray &data)
 Calculates the checksum for data. More...
 
void reset ()
 Resets the calculation on a checksun for a stream. More...
 
void update (const QByteArray &buf)
 Updates the calculated checksum for the stream. More...
 
quint32 value ()
 Value of the checksum calculated for the stream passed throw update(). More...
 

Private Attributes

quint32 checksum
 

Detailed Description

This class wrappers the adler32 function with the QuaChecksum32 interface. See QuaChecksum32 for more info.

Definition at line 38 of file quaadler32.h.

Constructor & Destructor Documentation

QuaAdler32::QuaAdler32 ( )

Definition at line 30 of file quaadler32.cpp.

References reset().

31 {
32  reset();
33 }
void reset()
Resets the calculation on a checksun for a stream.
Definition: quaadler32.cpp:40

+ Here is the call graph for this function:

Member Function Documentation

quint32 QuaAdler32::calculate ( const QByteArray &  data)
virtual

data source data

Returns
data checksum

This function has no efect on the value returned by value().

Implements QuaChecksum32.

Definition at line 35 of file quaadler32.cpp.

36 {
37  return adler32( adler32(0L, Z_NULL, 0), (const Bytef*)data.data(), data.size() );
38 }
void QuaAdler32::reset ( )
virtual

Implements QuaChecksum32.

Definition at line 40 of file quaadler32.cpp.

References checksum.

Referenced by QuaAdler32().

41 {
42  checksum = adler32(0L, Z_NULL, 0);
43 }
quint32 checksum
Definition: quaadler32.h:51

+ Here is the caller graph for this function:

void QuaAdler32::update ( const QByteArray &  buf)
virtual

buf next portion of data from the stream

Implements QuaChecksum32.

Definition at line 45 of file quaadler32.cpp.

References checksum.

46 {
47  checksum = adler32( checksum, (const Bytef*)buf.data(), buf.size() );
48 }
quint32 checksum
Definition: quaadler32.h:51
quint32 QuaAdler32::value ( )
virtual
Returns
checksum

Implements QuaChecksum32.

Definition at line 50 of file quaadler32.cpp.

References checksum.

51 {
52  return checksum;
53 }
quint32 checksum
Definition: quaadler32.h:51

Field Documentation

quint32 QuaAdler32::checksum
private

Definition at line 51 of file quaadler32.h.

Referenced by reset(), update(), and value().


The documentation for this class was generated from the following files: