|
QuickHash Library |
C++ Interface |
|
CSHA1
CSHA1 class does not have a base class.
CSHA1 class assists you in generating SHA1
message digests.
SHA1 message digests can be generated in two modes:
accumulative and non-accumulative.
The accumulative mode is applied when the data for
which the digest is calculated (data) represents one or more continuous
memory block(s) or when the data is created at runtime in many steps (for
instance, when reading a file).
Non-accumulative mode can be applied when the data
represents only one continuous memory block.
Note. When the data represents just one
continuous memory block, both methods can be applied.
To generate the message digest in the accumulative
mode, perform the following:
-
Instantiate a CSHA1 object.
-
Call the
Update member
function for each continuous memory block of data to perform the
calculations.
-
Call the
Final or call
the
FinalHex
member function to obtain the message digest.
Note. Call the
FinalHex
member function when you need to retrieve the hexadecimal string
representation of the message digest.
To generate the message digest in the
non-accumulative mode, perform the following:
-
Call the Calculate
or the
CalculateHex
static member function to calculate and retrieve the message digest.
Note. Call the
CalculateHex
static member function when you need to retrieve the hexadecimal string
representation of the message digest.
| #include <QuickHash.h>
using namespace QuickHash; |
Class Members
|
Useful Links | HashCalc
Samples SHA1 message digest generation for a file
SHA1 message digest generation for a string
|