QuaZip quazip-1-4
Public Member Functions | List of all members
QuaChecksum32 Class Referenceabstract

Checksum interface. More...

#include <quazip/quachecksum32.h>

Inheritance diagram for QuaChecksum32:
Inheritance graph
[legend]

Public Member Functions

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

Detailed Description

Checksum interface.

This is an interface for 32 bit checksums. Classes implementing this interface can calcunate a certin checksum in a single step:

QChecksum32 *crc32 = new QuaCrc32();
rasoult = crc32->calculate(data);
CRC32 checksum.
Definition: quacrc32.h:35

or by streaming the data:

QChecksum32 *crc32 = new QuaCrc32();
while(!fileA.atEnd())
crc32->update(fileA.read(bufSize));
resoultA = crc32->value();
crc32->reset();
while(!fileB.atEnd())
crc32->update(fileB.read(bufSize));
resoultB = crc32->value();

Member Function Documentation

◆ calculate()

virtual quint32 QuaChecksum32::calculate ( const QByteArray data)
pure virtual

Calculates the checksum for data.

data source data

Returns
data checksum

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

Implemented in QuaAdler32, and QuaCrc32.

◆ reset()

virtual void QuaChecksum32::reset ( )
pure virtual

Resets the calculation on a checksun for a stream.

Implemented in QuaAdler32, and QuaCrc32.

◆ update()

virtual void QuaChecksum32::update ( const QByteArray buf)
pure virtual

Updates the calculated checksum for the stream.

buf next portion of data from the stream

Implemented in QuaAdler32, and QuaCrc32.

◆ value()

virtual quint32 QuaChecksum32::value ( )
pure virtual

Value of the checksum calculated for the stream passed throw update().

Returns
checksum

Implemented in QuaAdler32, and QuaCrc32.


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