Functions to compute SHA1 message digest according to the NIST specification FIPS-180-1. More...
Public Member Functions | |
SHA1 () | |
Construct null. More... | |
SHA1 (const char *str) | |
Construct null and append initial string. More... | |
SHA1 (const std::string &str) | |
Construct null and append initial std::string. More... | |
void | clear () |
Reset the hashed data before appending more. More... | |
SHA1 & | append (const char *str) |
Append data for processing. More... | |
SHA1 & | append (const char *data, size_t len) |
Append data for processing. More... | |
SHA1 & | append (const std::string &str) |
Append string for processing. More... | |
SHA1 & | append (const std::string &str, size_t pos, size_t len=std::string::npos) |
Append substring for processing. More... | |
bool | finalize () |
Finalized the calculations (normally not needed directly). More... | |
SHA1Digest | digest () const |
Calculate digest from current data. More... | |
std::string | str (const bool prefixed=false) const |
The digest (40-byte) text representation, optionally with '_' prefix. More... | |
Ostream & | write (Ostream &os, const bool prefixed=false) const |
Write digest (40-byte) representation, optionally with '_' prefix. More... | |
operator SHA1Digest () const | |
Cast conversion to a SHA1Digest,. More... | |
bool | operator== (const SHA1 &rhs) const |
Equality operator, compares digests. More... | |
bool | operator== (const SHA1Digest &dig) const |
Compare digest. More... | |
bool | operator== (const std::string &hexdigits) const |
Compare digest to (40-byte) text representation (eg, from sha1sum) More... | |
bool | operator== (const char *hexdigits) const |
Compare digest to (40-byte) text representation (eg, from sha1sum) More... | |
bool | operator!= (const SHA1 &) const |
Inequality operator, compares digests. More... | |
bool | operator!= (const SHA1Digest &) const |
Inequality operator, compare digest. More... | |
bool | operator!= (const std::string &hexdigits) const |
Inequality operator, compares digests. More... | |
bool | operator!= (const char *hexdigits) const |
Inequality operator, compare digest. More... | |
Functions to compute SHA1 message digest according to the NIST specification FIPS-180-1.
Adapted from the gnulib implementation.
|
inline |
Construct null.
Definition at line 34 of file SHA1I.H.
References SHA1::clear().
|
inlineexplicit |
|
inlineexplicit |
void clear | ( | ) |
Reset the hashed data before appending more.
Definition at line 315 of file SHA1.C.
Referenced by OSHA1streamAllocator::reset(), and SHA1::SHA1().
|
inline |
Append data for processing.
Definition at line 63 of file SHA1I.H.
Referenced by dynamicCodeContext::append().
|
inline |
|
inline |
|
inline |
Append substring for processing.
Definition at line 81 of file SHA1I.H.
References Foam::pos().
bool finalize | ( | ) |
Finalized the calculations (normally not needed directly).
Returns false if no bytes were passed for processing
Definition at line 330 of file SHA1.C.
Referenced by SHA1::digest().
|
inline |
Calculate digest from current data.
Definition at line 101 of file SHA1I.H.
References SHA1::finalize().
Referenced by OSHA1streamAllocator::digest(), and SHA1::operator==().
|
inline |
The digest (40-byte) text representation, optionally with '_' prefix.
Definition at line 123 of file SHA1I.H.
Referenced by codeStream::getFunction(), dynamicCode::setFilterContext(), and codedBase::updateLibrary().
|
inline |
Write digest (40-byte) representation, optionally with '_' prefix.
Definition at line 129 of file SHA1I.H.
References Ostream::write().
Referenced by Foam::operator<<().
|
inline |
Cast conversion to a SHA1Digest,.
calculates the digest from the current data
Equality operator, compares digests.
Definition at line 143 of file SHA1I.H.
References SHA1::digest().
|
inline |
|
inline |
|
inline |
Inequality operator, compares digests.
Definition at line 167 of file SHA1I.H.
References Foam::operator==().
|
inline |
Inequality operator, compare digest.
Definition at line 173 of file SHA1I.H.
References Foam::operator==().
|
inline |
Inequality operator, compares digests.
Definition at line 179 of file SHA1I.H.
References Foam::operator==().
|
inline |
Inequality operator, compare digest.
Definition at line 185 of file SHA1I.H.
References Foam::operator==().