Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
KODI::UTILITY::CDigest Class Reference

#include <Digest.h>

Public Types

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

Public Member Functions

 CDigest (Type type)
 
void Update (std::string const &data)
 
void Update (void const *data, std::size_t size)
 
std::string Finalize ()
 
std::string FinalizeRaw ()
 

Static Public Member Functions

static std::string TypeToString (Type type)
 
static Type TypeFromString (std::string const &type)
 
static std::string Calculate (Type type, std::string const &data)
 
static std::string Calculate (Type type, void const *data, std::size_t size)
 

Detailed Description

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

Member Enumeration Documentation

◆ Type

enum class KODI::UTILITY::CDigest::Type
strong
Enumerator
MD5 
SHA1 
SHA256 
SHA512 
INVALID 

Constructor & Destructor Documentation

◆ CDigest()

KODI::UTILITY::CDigest::CDigest ( Type type)

Create a digest calculation object

Member Function Documentation

◆ Calculate() [1/2]

std::string KODI::UTILITY::CDigest::Calculate ( Type type,
std::string const & data )
static

Calculate message digest

◆ Calculate() [2/2]

std::string KODI::UTILITY::CDigest::Calculate ( Type type,
void const * data,
std::size_t size )
static

Calculate message digest

◆ 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

◆ TypeFromString()

CDigest::Type KODI::UTILITY::CDigest::TypeFromString ( std::string const & type)
static

Convert digest type string representation to enumeration value

◆ TypeToString()

std::string KODI::UTILITY::CDigest::TypeToString ( Type type)
static

Convert type enumeration value to lower-case string representation

◆ 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: