RSTT  3.2.0
Regional Seismic Travel Time
All Classes Namespaces Files Functions Variables Typedefs Friends Macros
util::MD50 Class Reference

This code implements the MD5 message-digest algorithm. The algorithm is due to Ron Rivest. This code was written by Colin Plumb in 1993, no copyright is claimed. This code is in the public domain; do with it what you wish. More...

#include <MD50.h>

Public Member Functions

 MD50 ()
 
 MD50 (const MD50 &md50)
 
virtual ~MD50 ()
 
MD50operator= (const MD50 &md50)
 
const string & getMD5HashHex (uchar const *data, int sze)
 Given an input data array and size sze, this function creates a 32 byte hexadecimal MD5 hash key from the data and returns the result as a string. No checking is performed on the size of the input array data. More...
 
void getMD5HashHex (uchar const *data, int sze, string &hhstr)
 
void getMD5HashHex (const string &sin, string &hhstr)
 Given an input data array and size sze, this function creates a 32 byte hexadecimal MD5 hash key from the data and returns the result in hhstr. No checking is performed on the size of the input array data. More...
 
const string & getMD5HashHex () const
 
void getMD5HashHex (string &s) const
 
cuchar const * getMD5HashBin (uchar const *data, int sze)
 Given an input data array and size sze, this function creates an MD5 hash key from the data and stores the 16 byte binary key in the attribute array hashkey. No checking is performed on the size of the array data. More...
 
cuchar const * getMD5HashBin ()
 Returns the 16 byte binary hash key. This function assumes that the MD5 conversion has already been performed. More...
 
void setDefaultEndian ()
 Sets the big endian flag to br. More...
 
void setBigEndian ()
 Sets the big endian flag to true. More...
 
void setLittleEndian ()
 Sets the big endian flag to false. More...
 
bool getByteReverse () const
 Returns the big endian flag setting. More...
 

Static Public Member Functions

static int hexStringSize ()
 Returns the hexadecimal size of an MD5 hash key. More...
 
static int hexSize ()
 Returns the hexadecimal size of an MD5 hash key. More...
 
static int binSize ()
 Returns the binary size of an MD5 hash key. More...
 
static bool isBigEndian ()
 

Detailed Description

This code implements the MD5 message-digest algorithm. The algorithm is due to Ron Rivest. This code was written by Colin Plumb in 1993, no copyright is claimed. This code is in the public domain; do with it what you wish.

The MD5 code was converted to an MD5 C++ object (MD50) by Jim Hipp, Sandia National Laboratories, in May of 2004. The code was modified Specifically for the PGL library and optimized to replace all "define" definitions with equivalent inlined function objects. The machine dependent byte reversal flag is called automatically at object construction to turn byte-reversal ON (big-endian) or OFF (little-endian). The flag can be manually set to either-endian format with the functions setBigEndian() or setLittleEndian().

The 32 byte hexadecimal string message digest is computed with any of the functions getMD5HashHex(...). The equivalent 16 byte binary message digest is returned with the functions getMD5BinHex(...).

Definition at line 81 of file MD50.h.

Constructor & Destructor Documentation

◆ MD50() [1/2]

util::MD50::MD50 ( )

◆ MD50() [2/2]

util::MD50::MD50 ( const MD50 md50)

◆ ~MD50()

virtual util::MD50::~MD50 ( )
virtual

Member Function Documentation

◆ binSize()

int util::MD50::binSize ( )
inlinestatic

Returns the binary size of an MD5 hash key.

Definition at line 218 of file MD50.h.

◆ getByteReverse()

bool util::MD50::getByteReverse ( ) const
inline

Returns the big endian flag setting.

Definition at line 261 of file MD50.h.

◆ getMD5HashBin() [1/2]

cuchar const * util::MD50::getMD5HashBin ( )
inline

Returns the 16 byte binary hash key. This function assumes that the MD5 conversion has already been performed.

Definition at line 339 of file MD50.h.

◆ getMD5HashBin() [2/2]

cuchar const * util::MD50::getMD5HashBin ( uchar const *  data,
int  sze 
)
inline

Given an input data array and size sze, this function creates an MD5 hash key from the data and stores the 16 byte binary key in the attribute array hashkey. No checking is performed on the size of the array data.

Definition at line 325 of file MD50.h.

◆ getMD5HashHex() [1/5]

const string& util::MD50::getMD5HashHex ( ) const

◆ getMD5HashHex() [2/5]

void util::MD50::getMD5HashHex ( const string &  sin,
string &  hhstr 
)
inline

Given an input data array and size sze, this function creates a 32 byte hexadecimal MD5 hash key from the data and returns the result in hhstr. No checking is performed on the size of the input array data.

Given an input string sin, this function creates a 32 byte hexadecimal MD5 hash key from the strings data and returns the result in hhstr.

Definition at line 307 of file MD50.h.

◆ getMD5HashHex() [3/5]

void util::MD50::getMD5HashHex ( string &  s) const

◆ getMD5HashHex() [4/5]

const string & util::MD50::getMD5HashHex ( uchar const *  data,
int  sze 
)
inline

Given an input data array and size sze, this function creates a 32 byte hexadecimal MD5 hash key from the data and returns the result as a string. No checking is performed on the size of the input array data.

Definition at line 274 of file MD50.h.

◆ getMD5HashHex() [5/5]

void util::MD50::getMD5HashHex ( uchar const *  data,
int  sze,
string &  hhstr 
)
inline

Definition at line 104 of file MD50.h.

◆ hexSize()

int util::MD50::hexSize ( )
inlinestatic

Returns the hexadecimal size of an MD5 hash key.

Definition at line 208 of file MD50.h.

◆ hexStringSize()

int util::MD50::hexStringSize ( )
inlinestatic

Returns the hexadecimal size of an MD5 hash key.

Definition at line 198 of file MD50.h.

◆ isBigEndian()

static bool util::MD50::isBigEndian ( )
static

◆ operator=()

MD50& util::MD50::operator= ( const MD50 md50)

◆ setBigEndian()

void util::MD50::setBigEndian ( )
inline

Sets the big endian flag to true.

Definition at line 241 of file MD50.h.

◆ setDefaultEndian()

void util::MD50::setDefaultEndian ( )
inline

Sets the big endian flag to br.

Definition at line 228 of file MD50.h.

◆ setLittleEndian()

void util::MD50::setLittleEndian ( )
inline

Sets the big endian flag to false.

Definition at line 251 of file MD50.h.


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