#include <opennurbs_md5.h>

Public Member Functions

 ON_MD5_Hash ()
 Default constructor is the zero digest hash. More...
 
 ON_MD5_Hash (const ON_MD5_Hash &)=default
 
 ~ON_MD5_Hash ()=default
 
void Dump (class ON_TextLog &text_log) const
 
ON_MD5_Hashoperator= (const ON_MD5_Hash &)=default
 
bool Read (class ON_BinaryArchive &archive)
 
const ON_wString ToString (bool bUpperCaseHexadecimalDigits) const
 
const ON_String ToUTF8String (bool bUpperCaseHexadecimalDigits) const
 
bool Write (class ON_BinaryArchive &archive) const
 

Static Public Member Functions

static ON_MD5_Hash BufferHash (const void *buffer, size_t sizeof_buffer)
 
static int Compare (const ON_MD5_Hash &a, const ON_MD5_Hash &b)
 
static ON_MD5_Hash FileHash (const wchar_t *filename, ON__UINT64 &sizeof_file)
 
static ON_MD5_Hash FileHash (const char *filename, ON__UINT64 &sizeof_file)
 
static ON_MD5_Hash FileHash (FILE *file, ON__UINT64 &sizeof_file)
 
static ON_MD5_Hash StringHash (const ON_wString &str, ON__UINT64 &byte_count)
 
static ON_MD5_Hash StringHash (const wchar_t *str, size_t str_length, ON__UINT64 &byte_count)
 
static ON_MD5_Hash StringHash (const ON_String &str, ON__UINT64 &byte_count)
 
static ON_MD5_Hash StringHash (const char *str, size_t str_length, ON__UINT64 &byte_count)
 

Public Attributes

ON__UINT8 m_digest [16]
 

Static Public Attributes

static const ON_MD5_Hash EmptyContentHash
 
static const ON_MD5_Hash ZeroDigest
 

Constructor & Destructor Documentation

◆ ON_MD5_Hash() [1/2]

ON_MD5_Hash::ON_MD5_Hash ( )

Default constructor is the zero digest hash.

◆ ~ON_MD5_Hash()

ON_MD5_Hash::~ON_MD5_Hash ( )
default

◆ ON_MD5_Hash() [2/2]

ON_MD5_Hash::ON_MD5_Hash ( const ON_MD5_Hash )
default

Member Function Documentation

◆ BufferHash()

static ON_MD5_Hash ON_MD5_Hash::BufferHash ( const void *  buffer,
size_t  sizeof_buffer 
)
static
Parameters
buffer[in]
sizeof_buffer[in] number of bytes in buffer
Returns
MD5 hash of the buffer.

◆ Compare()

static int ON_MD5_Hash::Compare ( const ON_MD5_Hash a,
const ON_MD5_Hash b 
)
static

◆ Dump()

void ON_MD5_Hash::Dump ( class ON_TextLog text_log) const

◆ FileHash() [1/3]

static ON_MD5_Hash ON_MD5_Hash::FileHash ( const wchar_t *  filename,
ON__UINT64 &  sizeof_file 
)
static
Parameters
filename[in] Name of file
sizeof_file[out] number of bytes in file
Returns
MD5 hash of the buffer.

◆ FileHash() [2/3]

static ON_MD5_Hash ON_MD5_Hash::FileHash ( const char *  filename,
ON__UINT64 &  sizeof_file 
)
static

◆ FileHash() [3/3]

static ON_MD5_Hash ON_MD5_Hash::FileHash ( FILE *  file,
ON__UINT64 &  sizeof_file 
)
static
Parameters
file[in] File stream from ON_FileStream::Open(...,L"rb");
sizeof_file[out] number of bytes in file
Returns
MD5 hash of the file stream from the current offset to the end of the file.

◆ operator=()

ON_MD5_Hash& ON_MD5_Hash::operator= ( const ON_MD5_Hash )
default

◆ Read()

bool ON_MD5_Hash::Read ( class ON_BinaryArchive archive)

◆ StringHash() [1/4]

static ON_MD5_Hash ON_MD5_Hash::StringHash ( const ON_wString str,
ON__UINT64 &  byte_count 
)
static
Parameters
str[in] string
byte_count[out] number of bytes in UTF-8 encoding of the string.
Returns
MD5 hash of the UTF-8 encoding of the string. (Platforms and endian independent.)

◆ StringHash() [2/4]

static ON_MD5_Hash ON_MD5_Hash::StringHash ( const wchar_t *  str,
size_t  str_length,
ON__UINT64 &  byte_count 
)
static

◆ StringHash() [3/4]

static ON_MD5_Hash ON_MD5_Hash::StringHash ( const ON_String str,
ON__UINT64 &  byte_count 
)
static
Parameters
str[in]
byte_count[out] number of bytes in the string.
Returns
MD5 hash of the UTF-8 encoding of the string. (Platforms and endian independent.)

◆ StringHash() [4/4]

static ON_MD5_Hash ON_MD5_Hash::StringHash ( const char *  str,
size_t  str_length,
ON__UINT64 &  byte_count 
)
static

◆ ToString()

const ON_wString ON_MD5_Hash::ToString ( bool  bUpperCaseHexadecimalDigits) const
Parameters
bUpperCaseHexadecimalDigits[in]
falseuse 0-9, a-f
trueuse 0-9, A-F
Returns
The MD5 hash value as a 32 hexadecimal digits. The first digit in the string is the hexadecimal value of m_digest[0].

◆ ToUTF8String()

const ON_String ON_MD5_Hash::ToUTF8String ( bool  bUpperCaseHexadecimalDigits) const
Parameters
bUpperCaseHexadecimalDigits[in]
falseuse 0-9, a-f
trueuse 0-9, A-F
Returns
The MD5 hash value as a 32 hexadecimal digits. The first digit in the string is the hexadecimal value of m_digest[0].

◆ Write()

bool ON_MD5_Hash::Write ( class ON_BinaryArchive archive) const

Member Data Documentation

◆ EmptyContentHash

const ON_MD5_Hash ON_MD5_Hash::EmptyContentHash
static

◆ m_digest

ON__UINT8 ON_MD5_Hash::m_digest[16]

◆ ZeroDigest

const ON_MD5_Hash ON_MD5_Hash::ZeroDigest
static