The SHA1 message digest. More...
Public Member Functions | |
SHA1Digest () | |
Construct a zero digest. More... | |
SHA1Digest (Istream &) | |
Construct read a digest. More... | |
void | clear () |
Reset the digest to zero. More... | |
bool | empty () const |
Return true if the digest is empty (ie, all zero). More... | |
std::string | str (const bool prefixed=false) const |
Return (40-byte) text representation, optionally with '_' prefix. More... | |
Ostream & | write (Ostream &, const bool prefixed=false) const |
Write (40-byte) text representation, optionally with '_' prefix. More... | |
bool | operator== (const SHA1Digest &) const |
Equality operator. More... | |
bool | operator== (const std::string &hexdigits) const |
Compare to (40-byte) text representation (eg, from sha1sum) More... | |
bool | operator== (const char *hexdigits) const |
Compare to (40-byte) text representation (eg, from sha1sum) More... | |
bool | operator!= (const SHA1Digest &) const |
Inequality operator. More... | |
bool | operator!= (const std::string &hexdigits) const |
Inequality operator. More... | |
bool | operator!= (const char *hexdigits) const |
Inequality operator. More... | |
Static Public Attributes | |
static const unsigned | length = 20 |
The length of the (uncoded) digest contents. More... | |
static const SHA1Digest | null |
A null digest (ie, all zero) More... | |
Friends | |
class | SHA1 |
Istream & | operator>> (Istream &, SHA1Digest &) |
Read (40-byte) text representation. More... | |
Ostream & | operator<< (Ostream &, const SHA1Digest &) |
Write (40-byte) text representation, unquoted and without prefix. More... | |
The SHA1 message digest.
Definition at line 62 of file SHA1Digest.H.
SHA1Digest | ( | ) |
Construct a zero digest.
Definition at line 78 of file SHA1Digest.C.
References SHA1Digest::clear().
SHA1Digest | ( | Istream & | is | ) |
Construct read a digest.
Definition at line 84 of file SHA1Digest.C.
void clear | ( | ) |
Reset the digest to zero.
Definition at line 92 of file SHA1Digest.C.
References SHA1Digest::length.
Referenced by SHA1Digest::SHA1Digest().
bool empty | ( | ) | const |
Return true if the digest is empty (ie, all zero).
Definition at line 98 of file SHA1Digest.C.
References SHA1Digest::length.
Referenced by SHA1Digest::operator==().
std::string str | ( | const bool | prefixed = false | ) | const |
Return (40-byte) text representation, optionally with '_' prefix.
Definition at line 112 of file SHA1Digest.C.
References SHA1Digest::length.
Referenced by dynamicCode::reset(), and codedBase::updateLibrary().
Foam::Ostream & write | ( | Ostream & | os, |
const bool | prefixed = false |
||
) | const |
Write (40-byte) text representation, optionally with '_' prefix.
Definition at line 137 of file SHA1Digest.C.
References IOstream::check(), SHA1Digest::length, and Ostream::write().
Referenced by Foam::operator<<(), and dynamicCode::writeDigest().
bool operator== | ( | const SHA1Digest & | rhs | ) | const |
Equality operator.
Definition at line 157 of file SHA1Digest.C.
References SHA1Digest::length.
Referenced by SHA1Digest::operator!=().
bool operator== | ( | const std::string & | hexdigits | ) | const |
Compare to (40-byte) text representation (eg, from sha1sum)
An empty string is equivalent to "0000000000000000000000000000000000000000" The hexdigits may optionally start with a '_' prefix
Definition at line 171 of file SHA1Digest.C.
References Foam::constant::physicoChemical::c1, Foam::constant::physicoChemical::c2, SHA1Digest::empty(), and SHA1Digest::length.
bool operator== | ( | const char * | hexdigits | ) | const |
Compare to (40-byte) text representation (eg, from sha1sum)
A null or empty string is equivalent to "0000000000000000000000000000000000000000" The hexdigits may optionally start with a '_' prefix
Definition at line 205 of file SHA1Digest.C.
References Foam::constant::physicoChemical::c1, Foam::constant::physicoChemical::c2, SHA1Digest::empty(), and SHA1Digest::length.
bool operator!= | ( | const SHA1Digest & | rhs | ) | const |
Inequality operator.
Definition at line 239 of file SHA1Digest.C.
References SHA1Digest::operator==().
bool operator!= | ( | const std::string & | hexdigits | ) | const |
Inequality operator.
Definition at line 245 of file SHA1Digest.C.
References SHA1Digest::operator==().
bool operator!= | ( | const char * | hexdigits | ) | const |
Inequality operator.
Definition at line 251 of file SHA1Digest.C.
References SHA1Digest::operator==().
|
friend |
Definition at line 89 of file SHA1Digest.H.
|
friend |
Read (40-byte) text representation.
Since leading and intermediate underscores are skipped, a '_' can be prefixed to the text representation to use an unquoted SHA1Digest without parsing ambiguities as a number.
|
friend |
Write (40-byte) text representation, unquoted and without prefix.
|
static |
The length of the (uncoded) digest contents.
Definition at line 70 of file SHA1Digest.H.
Referenced by SHA1Digest::clear(), SHA1Digest::empty(), SHA1Digest::operator==(), Foam::operator>>(), SHA1Digest::str(), and SHA1Digest::write().
|
static |
A null digest (ie, all zero)
Definition at line 73 of file SHA1Digest.H.