41 #ifndef Foam_SHA1Digest_H 42 #define Foam_SHA1Digest_H 66 std::array<unsigned char, 20> dig_;
75 unsigned char* data()
noexcept {
return dig_.data(); }
97 SHA1Digest(
const char* content, std::size_t len);
102 SHA1Digest(
const unsigned char* content, std::size_t len);
114 std::string
str(
const bool prefixed=
false)
const;
129 const unsigned char*
cdata() const
noexcept {
return dig_.data(); }
135 return reinterpret_cast<const char*
>(dig_.data());
143 return reinterpret_cast<char*
>(dig_.data());
162 bool operator==(
const std::string& hexdigits)
const;
char * data_bytes() noexcept
Raw digest char data (20 bytes) - non-const access. For consistency with other objects, these are not unsigned. Use with caution - generally for broadcasting only.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
bool operator!=(const SHA1Digest &rhs) const
Inequality operator.
const char * cdata_bytes() const noexcept
Raw digest char data (20 bytes) - const access. For consistency with other objects, these are not unsigned.
Istream & operator>>(Istream &, directionInfo &)
SHA1Digest()
Default construct a zero digest.
const unsigned char * cdata() const noexcept
Raw digest data (20 bytes) - const access.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
bool empty() const
Return true if the digest is empty (ie, all zero).
OBJstream os(runTime.globalPath()/outputName)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Ostream & write(Ostream &os, const bool prefixed=false) const
Write (40-byte) text representation, optionally with '_' prefix.
void clear()
Reset the digest to zero.
bool operator==(const SHA1Digest &rhs) const
Equality operator.
static constexpr unsigned max_size() noexcept
The dimensioned size of the digest is always 20 bytes.
std::string str(const bool prefixed=false) const
Return (40-byte) text representation, optionally with '_' prefix.
static constexpr unsigned size_bytes() noexcept
The number of bytes in digest (20)
Functions to compute SHA1 message digest according to the NIST specification FIPS-180-1.
Istream & read(Istream &is)
Read (40-byte) text representation.
static const SHA1Digest null
A null digest (ie, all zero)