FreeFOAM The Cross-Platform CFD Toolkit
SHA1 Class Reference

Functions to compute SHA1 message digest according to the NIST specification FIPS-180-1. More...

#include <OpenFOAM/SHA1.H>


Detailed Description

Functions to compute SHA1 message digest according to the NIST specification FIPS-180-1.

Adapted from the gnulib implementation.

See also:
Foam::SHA1Digest
Source files

Definition at line 69 of file SHA1.H.

List of all members.

Public Member Functions

 SHA1 ()
 Construct null.
 SHA1 (const std::string &)
 Construct and append initial std::string.
 SHA1 (const char *)
 Construct and append initial string.
void clear ()
 Reset the hashed data before appending more.
SHA1append (const char *data, size_t len)
 Append data for processing.
SHA1append (const std::string &)
 Append string for processing.
SHA1append (const char *str)
 Append string for processing.
bool finalize ()
 Finalized the calculations (normally not needed directly).
SHA1Digest digest () const
 Calculate current digest from appended data.
bool operator== (const SHA1Digest &) const
 Equality operator.
bool operator!= (const SHA1Digest &) const
 Inequality operator.
bool operator== (const SHA1 &) const
 Equality operator.
bool operator!= (const SHA1 &) const
 Inequality operator.
 operator SHA1Digest () const
 Convert to a digest, calculate current digest from appended data.

Friends

Ostreamoperator<< (Ostream &, const SHA1 &)

Constructor & Destructor Documentation

SHA1 ( )
inline

Construct null.

Definition at line 31 of file SHA1I.H.

References SHA1::clear().

SHA1 ( const std::string &  str)
inlineexplicit

Construct and append initial std::string.

Definition at line 37 of file SHA1I.H.

References append(), and clear().

SHA1 ( const char *  str)
inlineexplicit

Construct and append initial string.

Definition at line 44 of file SHA1I.H.

References append(), and clear().


Member Function Documentation

void clear ( )

Reset the hashed data before appending more.

Definition at line 359 of file SHA1.C.

Referenced by OSHA1stream::rewind(), and SHA1::SHA1().

Foam::SHA1 & append ( const char *  data,
size_t  len 
)
inline

Append data for processing.

Definition at line 56 of file SHA1I.H.

Referenced by sha1streambuf::xsputn().

Foam::SHA1 & append ( const std::string &  str)
inline

Append string for processing.

Definition at line 63 of file SHA1I.H.

Foam::SHA1 & append ( const char *  str)
inline

Append string for processing.

Definition at line 70 of file SHA1I.H.

bool finalize ( )

Finalized the calculations (normally not needed directly).

Returns false if no bytes were passed for processing

Definition at line 374 of file SHA1.C.

Referenced by SHA1::digest().

Foam::SHA1Digest digest ( ) const

Calculate current digest from appended data.

Definition at line 413 of file SHA1.C.

References SHA1::finalize().

Referenced by OSHA1stream::digest(), SHA1::operator!=(), Foam::operator<<(), and SHA1::operator==().

bool operator== ( const SHA1Digest rhs) const
inline

Equality operator.

Definition at line 82 of file SHA1I.H.

bool operator!= ( const SHA1Digest rhs) const
inline

Inequality operator.

Definition at line 88 of file SHA1I.H.

bool operator== ( const SHA1 rhs) const
inline

Equality operator.

Definition at line 94 of file SHA1I.H.

References SHA1::digest().

bool operator!= ( const SHA1 rhs) const
inline

Inequality operator.

Definition at line 100 of file SHA1I.H.

References SHA1::digest().

operator SHA1Digest ( ) const
inline

Convert to a digest, calculate current digest from appended data.


Friends And Related Function Documentation

Ostream& operator<< ( Ostream ,
const SHA1  
)
friend

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