libhomegear-base  0.7
Base library for Homegear and Homegear family modules.
BaseLib::Security::Hash Class Reference

#include <Hash.h>

Public Member Functions

virtual ~Hash ()
 Destructor. More...
 

Static Public Member Functions

template<typename Data >
static bool sha1 (const Data &in, Data &out)
 Calculates the SHA1 of the passed binary data. More...
 
template<typename Data >
static bool sha256 (const Data &in, Data &out)
 Calculates the SHA256 of the passed binary data. More...
 
template<typename Data >
static bool sha512 (const Data &in, Data &out)
 Calculates the SHA512 of the passed binary data. More...
 
template<typename Data >
static bool md5 (const Data &in, Data &out)
 Calculates the MD5 of the passed binary data. More...
 
template<typename Data >
static bool whirlpool (const Data &in, Data &out)
 Calculates the WHIRLPOOL hash of the passed binary data. More...
 

Protected Member Functions

 Hash ()
 Constructor. More...
 

Constructor & Destructor Documentation

§ ~Hash()

virtual BaseLib::Security::Hash::~Hash ( )
virtual

Destructor.

Does nothing.

§ Hash()

BaseLib::Security::Hash::Hash ( )
protected

Constructor.

It is protected, because the class only contains static methods. It does nothing.

Member Function Documentation

§ md5()

template<typename Data >
bool BaseLib::Security::Hash::md5 ( const Data &  in,
Data &  out 
)
static

Calculates the MD5 of the passed binary data.

Parameters
[in]inThe data to calculate the MD5 for.
[out]outA vector to store the calculated MD5 in.
Returns
Returns "true" on success and "false" on error.

§ sha1()

template<typename Data >
bool BaseLib::Security::Hash::sha1 ( const Data &  in,
Data &  out 
)
static

Calculates the SHA1 of the passed binary data.

Parameters
[in]inThe data to calculate the SHA1 for.
[out]outA vector to store the calculated SHA1 in.
Returns
Returns "true" on success and "false" on error.

§ sha256()

template<typename Data >
bool BaseLib::Security::Hash::sha256 ( const Data &  in,
Data &  out 
)
static

Calculates the SHA256 of the passed binary data.

Parameters
[in]inThe data to calculate the SHA256 for.
[out]outA vector to store the calculated SHA256 in.
Returns
Returns "true" on success and "false" on error.

§ sha512()

template<typename Data >
bool BaseLib::Security::Hash::sha512 ( const Data &  in,
Data &  out 
)
static

Calculates the SHA512 of the passed binary data.

Parameters
[in]inThe data to calculate the SHA512 for.
[out]outA vector to store the calculated SHA512 in.
Returns
Returns "true" on success and "false" on error.

§ whirlpool()

template<typename Data >
bool BaseLib::Security::Hash::whirlpool ( const Data &  in,
Data &  out 
)
static

Calculates the WHIRLPOOL hash of the passed binary data.

Parameters
[in]inThe data to calculate the hash for.
[out]outA vector to store the calculated hash in.
Returns
Returns "true" on success and "false" on error.

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