kodi
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
KODI::UTILITY::CDigest Class Reference

Utility class for calculating message digests/hashes, currently using OpenSSL. More...

#include <Digest.h>

Public Types

enum  Type {
  MD5, SHA1, SHA256, SHA512,
  INVALID
}
 

Public Member Functions

 CDigest (Type type)
 Create a digest calculation object.
 
void Update (std::string const &data)
 Update digest with data. More...
 
void Update (void const *data, std::size_t size)
 Update digest with data. More...
 
std::string Finalize ()
 Finalize and return the digest. More...
 
std::string FinalizeRaw ()
 Finalize and return the digest. More...
 

Static Public Member Functions

static std::string TypeToString (Type type)
 Convert type enumeration value to lower-case string representation.
 
static Type TypeFromString (std::string const &type)
 Convert digest type string representation to enumeration value.
 
static std::string Calculate (Type type, std::string const &data)
 Calculate message digest.
 
static std::string Calculate (Type type, void const *data, std::size_t size)
 Calculate message digest.
 

Detailed Description

Utility class for calculating message digests/hashes, currently using OpenSSL.

Member Function Documentation

◆ Finalize()

std::string KODI::UTILITY::CDigest::Finalize ( )

Finalize and return the digest.

The digest object cannot be used any more after this function has been called.

Returns
digest value as string in lower-case hexadecimal notation

◆ FinalizeRaw()

std::string KODI::UTILITY::CDigest::FinalizeRaw ( )

Finalize and return the digest.

The digest object cannot be used any more after this function has been called.

Returns
digest value as binary std::string

◆ Update() [1/2]

void KODI::UTILITY::CDigest::Update ( std::string const &  data)

Update digest with data.

Cannot be called after Finalize has been called

◆ Update() [2/2]

void KODI::UTILITY::CDigest::Update ( void const *  data,
std::size_t  size 
)

Update digest with data.

Cannot be called after Finalize has been called


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