SNAP Library 6.0, Developer Reference  2020-12-09 16:24:20
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
TMd5Sig Class Reference

#include <md5.h>

Public Member Functions

 TMd5Sig ()
 
 TMd5Sig (const TMd5Sig &Md5Sig)
 
 TMd5Sig (const PSIn &SIn)
 
 TMd5Sig (const TStr &Str)
 
 TMd5Sig (const TChA &ChA)
 
 TMd5Sig (const char *CStr)
 
 TMd5Sig (const TMem &Mem)
 
 TMd5Sig (const TMd5 &Md5)
 
 TMd5Sig (TSIn &SIn)
 
void Save (TSOut &SOut) const
 
TMd5Sigoperator= (const TMd5Sig &Md5Sig)
 
bool operator== (const TMd5Sig &Md5Sig) const
 
bool operator< (const TMd5Sig &Md5Sig) const
 
int operator[] (const int &CdN) const
 
int GetPrimHashCd () const
 
int GetSecHashCd () const
 
TStr GetStr () const
 
void GetUInt (const int &StartCd, uint &UInt) const
 

Private Types

typedef TB1Def::TB1 uint1
 

Private Attributes

uint1 CdT [16]
 

Detailed Description

Definition at line 81 of file md5.h.

Member Typedef Documentation

typedef TB1Def::TB1 TMd5Sig::uint1
private

Definition at line 83 of file md5.h.

Constructor & Destructor Documentation

TMd5Sig::TMd5Sig ( )
inline

Definition at line 86 of file md5.h.

86 {memset(CdT, 0, 16);}
uint1 CdT[16]
Definition: md5.h:84
TMd5Sig::TMd5Sig ( const TMd5Sig Md5Sig)
inline

Definition at line 87 of file md5.h.

References CdT.

87 {memcpy(CdT, Md5Sig.CdT, 16);}
uint1 CdT[16]
Definition: md5.h:84
TMd5Sig::TMd5Sig ( const PSIn SIn)

Definition at line 239 of file md5.cpp.

References CdT, and TMd5::New().

239  {
240  PMd5 Md5=TMd5::New(SIn);
241  memcpy(CdT, Md5->Sig, 16);
242 }
uint1 CdT[16]
Definition: md5.h:84
static PMd5 New()
Definition: md5.h:49
Definition: bd.h:196

Here is the call graph for this function:

TMd5Sig::TMd5Sig ( const TStr Str)

Definition at line 244 of file md5.cpp.

References CdT, TMd5::New(), and TStrIn::New().

244  {
245  PMd5 Md5=TMd5::New(TStrIn::New(Str));
246  memcpy(CdT, Md5->Sig, 16);
247 }
uint1 CdT[16]
Definition: md5.h:84
static PMd5 New()
Definition: md5.h:49
static PSIn New(const TStr &Str)
Definition: dt.h:711
Definition: bd.h:196

Here is the call graph for this function:

TMd5Sig::TMd5Sig ( const TChA ChA)

Definition at line 249 of file md5.cpp.

References TMd5::Add(), CdT, TChA::CStr(), TMd5::Def(), TChA::Len(), and TMd5::Sig.

249  {
250  TMd5 Md5; Md5.Add((uchar *) ChA.CStr(), ChA.Len()); Md5.Def();
251  memcpy(CdT, Md5.Sig, 16);
252 }
int Len() const
Definition: dt.h:259
uint1 CdT[16]
Definition: md5.h:84
void Add(uchar *InBf, const int &InBfL)
Definition: md5.cpp:148
Definition: md5.h:5
char * CStr()
Definition: dt.h:255
uint1 Sig[16]
Definition: md5.h:16
unsigned char uchar
Definition: bd.h:10
void Def()
Definition: md5.cpp:187

Here is the call graph for this function:

TMd5Sig::TMd5Sig ( const char *  CStr)

Definition at line 254 of file md5.cpp.

References TMd5::Add(), CdT, TMd5::Def(), and TMd5::Sig.

254  {
255  TMd5 Md5; Md5.Add((uchar *) CStr, (int) strlen(CStr)); Md5.Def();
256  memcpy(CdT, Md5.Sig, 16);
257 }
uint1 CdT[16]
Definition: md5.h:84
void Add(uchar *InBf, const int &InBfL)
Definition: md5.cpp:148
Definition: md5.h:5
uint1 Sig[16]
Definition: md5.h:16
unsigned char uchar
Definition: bd.h:10
void Def()
Definition: md5.cpp:187

Here is the call graph for this function:

TMd5Sig::TMd5Sig ( const TMem Mem)

Definition at line 259 of file md5.cpp.

References CdT, TMd5::New(), and TMemIn::New().

259  {
260  PMd5 Md5=TMd5::New(TMemIn::New(Mem));
261  memcpy(CdT, Md5->Sig, 16);
262 }
static PSIn New(const TMem &Mem)
Definition: dt.h:165
uint1 CdT[16]
Definition: md5.h:84
static PMd5 New()
Definition: md5.h:49
Definition: bd.h:196

Here is the call graph for this function:

TMd5Sig::TMd5Sig ( const TMd5 Md5)
inline

Definition at line 93 of file md5.h.

References TMd5::Sig.

93 {memcpy(CdT, Md5.Sig, 16);}
uint1 CdT[16]
Definition: md5.h:84
uint1 Sig[16]
Definition: md5.h:16
TMd5Sig::TMd5Sig ( TSIn SIn)
inline

Definition at line 94 of file md5.h.

References TSIn::LoadBf().

94 {SIn.LoadBf(CdT, 16);}
uint1 CdT[16]
Definition: md5.h:84
void LoadBf(const void *Bf, const TSize &BfL)
Definition: fl.h:81

Here is the call graph for this function:

Member Function Documentation

int TMd5Sig::GetPrimHashCd ( ) const

Definition at line 264 of file md5.cpp.

References CdT.

Referenced by TStrHashF_Md5::GetPrimHashCd().

264  {
265  int HashCd=0;
266  memcpy(&HashCd, &CdT[0], 4);
267  HashCd=abs(HashCd);
268  return HashCd;
269 }
uint1 CdT[16]
Definition: md5.h:84

Here is the caller graph for this function:

int TMd5Sig::GetSecHashCd ( ) const

Definition at line 271 of file md5.cpp.

References CdT.

Referenced by TStrHashF_Md5::GetSecHashCd().

271  {
272  int HashCd=0;
273  memcpy(&HashCd, &CdT[3], 4);
274  HashCd=abs(HashCd);
275  return HashCd;
276 }
uint1 CdT[16]
Definition: md5.h:84

Here is the caller graph for this function:

TStr TMd5Sig::GetStr ( ) const

Definition at line 278 of file md5.cpp.

References CdT, and TCh::GetHexCh().

278  {
279  TChA ChA(32);
280  for (int CdN=0; CdN<16; CdN++){
281  ChA+=TCh::GetHexCh(CdT[CdN]/16);
282  ChA+=TCh::GetHexCh(CdT[CdN]%16);
283  }
284  return ChA;
285 }
static char GetHexCh(const int &Val)
Definition: dt.h:1077
uint1 CdT[16]
Definition: md5.h:84
Definition: dt.h:201

Here is the call graph for this function:

void TMd5Sig::GetUInt ( const int &  StartCd,
uint UInt 
) const
inline

Definition at line 112 of file md5.h.

112  {
113  memcpy(&UInt, CdT+StartCd, sizeof(uint));}
unsigned int uint
Definition: bd.h:11
uint1 CdT[16]
Definition: md5.h:84
bool TMd5Sig::operator< ( const TMd5Sig Md5Sig) const
inline

Definition at line 101 of file md5.h.

References CdT.

101  {
102  return memcmp(CdT, Md5Sig.CdT, 16)==-1;}
uint1 CdT[16]
Definition: md5.h:84
TMd5Sig& TMd5Sig::operator= ( const TMd5Sig Md5Sig)
inline

Definition at line 97 of file md5.h.

References CdT.

97  {
98  if (this!=&Md5Sig){memcpy(CdT, Md5Sig.CdT, 16);} return *this;}
uint1 CdT[16]
Definition: md5.h:84
bool TMd5Sig::operator== ( const TMd5Sig Md5Sig) const
inline

Definition at line 99 of file md5.h.

References CdT.

99  {
100  return memcmp(CdT, Md5Sig.CdT, 16)==0;}
uint1 CdT[16]
Definition: md5.h:84
int TMd5Sig::operator[] ( const int &  CdN) const
inline

Definition at line 103 of file md5.h.

References Assert.

103  {
104  Assert((0<=CdN)&&(CdN<16)); return CdT[CdN];}
uint1 CdT[16]
Definition: md5.h:84
#define Assert(Cond)
Definition: bd.h:251
void TMd5Sig::Save ( TSOut SOut) const
inline

Definition at line 95 of file md5.h.

References TSOut::SaveBf().

95 {SOut.SaveBf(CdT, 16);}
uint1 CdT[16]
Definition: md5.h:84
void SaveBf(const void *Bf, const TSize &BfL)
Definition: fl.h:172

Here is the call graph for this function:

Member Data Documentation

uint1 TMd5Sig::CdT[16]
private

Definition at line 84 of file md5.h.

Referenced by GetPrimHashCd(), GetSecHashCd(), GetStr(), operator<(), operator=(), operator==(), and TMd5Sig().


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