KanoopCommonQt 2.1.1
Kanoop foundational Qt utility library
Loading...
Searching...
No Matches
CryptoUtil::Hasher Class Reference

Stateful incremental hasher for streamed input. More...

#include <cryptoutil.h>

Public Member Functions

 Hasher (Algorithm algorithm)
 Construct a hasher for the given algorithm.
 
void addData (const QByteArray &data)
 Append data to the running hash.
 
void reset ()
 Reset the hash state so the instance can be reused.
 
QByteArray result () const
 Return the current digest as raw bytes.
 
QString resultString () const
 Return the current digest as a lowercase hex string.
 

Detailed Description

Stateful incremental hasher for streamed input.

For cases where the full input isn't available up front (e.g. streaming network downloads). Hex output matches the static md5String/sha256String helpers in this class.

Definition at line 140 of file cryptoutil.h.

Constructor & Destructor Documentation

◆ Hasher()

CryptoUtil::Hasher::Hasher ( Algorithm  algorithm)
explicit

Construct a hasher for the given algorithm.

Parameters
algorithmWhich digest to compute.

Member Function Documentation

◆ addData()

void CryptoUtil::Hasher::addData ( const QByteArray &  data)

Append data to the running hash.

Parameters
dataBytes to fold into the digest.

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