SNAP Library 2.1, User Reference  2013-09-25 10:47:25
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
TMd5Sig Class Reference

#include <md5.h>

List of all members.

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.

{memset(CdT, 0, 16);}
TMd5Sig::TMd5Sig ( const TMd5Sig Md5Sig) [inline]

Definition at line 87 of file md5.h.

{memcpy(CdT, Md5Sig.CdT, 16);}
TMd5Sig::TMd5Sig ( const PSIn SIn)

Definition at line 239 of file md5.cpp.

                               {
  PMd5 Md5=TMd5::New(SIn);
  memcpy(CdT, Md5->Sig, 16);
}
TMd5Sig::TMd5Sig ( const TStr Str)

Definition at line 244 of file md5.cpp.

                               {
  PMd5 Md5=TMd5::New(TStrIn::New(Str));
  memcpy(CdT, Md5->Sig, 16);
}
TMd5Sig::TMd5Sig ( const TChA ChA)

Definition at line 249 of file md5.cpp.

                                {
  TMd5 Md5;  Md5.Add((uchar *) ChA.CStr(), ChA.Len());  Md5.Def();
  memcpy(CdT, Md5.Sig, 16);
}
TMd5Sig::TMd5Sig ( const char *  CStr)

Definition at line 254 of file md5.cpp.

                                 {
  TMd5 Md5;  Md5.Add((uchar *) CStr, (int) strlen(CStr));  Md5.Def();
  memcpy(CdT, Md5.Sig, 16);
}
TMd5Sig::TMd5Sig ( const TMem Mem)

Definition at line 259 of file md5.cpp.

                               {
  PMd5 Md5=TMd5::New(TMemIn::New(Mem));
  memcpy(CdT, Md5->Sig, 16);
}
TMd5Sig::TMd5Sig ( const TMd5 Md5) [inline]

Definition at line 93 of file md5.h.

{memcpy(CdT, Md5.Sig, 16);}
TMd5Sig::TMd5Sig ( TSIn SIn) [inline]

Definition at line 94 of file md5.h.

{SIn.LoadBf(CdT, 16);}

Member Function Documentation

int TMd5Sig::GetPrimHashCd ( ) const

Definition at line 264 of file md5.cpp.

                                 {
  int HashCd=0;
  memcpy(&HashCd, &CdT[0], 4);
  HashCd=abs(HashCd);
  return HashCd;
}
int TMd5Sig::GetSecHashCd ( ) const

Definition at line 271 of file md5.cpp.

                                {
  int HashCd=0;
  memcpy(&HashCd, &CdT[3], 4);
  HashCd=abs(HashCd);
  return HashCd;
}
TStr TMd5Sig::GetStr ( ) const

Definition at line 278 of file md5.cpp.

                           {
  TChA ChA(32);
  for (int CdN=0; CdN<16; CdN++){
    ChA+=TCh::GetHexCh(CdT[CdN]/16);
    ChA+=TCh::GetHexCh(CdT[CdN]%16);
  }
  return ChA;
}
void TMd5Sig::GetUInt ( const int &  StartCd,
uint UInt 
) const [inline]

Definition at line 112 of file md5.h.

                                                     {
    memcpy(&UInt, CdT+StartCd, sizeof(uint));}
bool TMd5Sig::operator< ( const TMd5Sig Md5Sig) const [inline]

Definition at line 101 of file md5.h.

                                              {
    return memcmp(CdT, Md5Sig.CdT, 16)==-1;}
TMd5Sig& TMd5Sig::operator= ( const TMd5Sig Md5Sig) [inline]

Definition at line 97 of file md5.h.

                                           {
    if (this!=&Md5Sig){memcpy(CdT, Md5Sig.CdT, 16);} return *this;}
bool TMd5Sig::operator== ( const TMd5Sig Md5Sig) const [inline]

Definition at line 99 of file md5.h.

                                               {
    return memcmp(CdT, Md5Sig.CdT, 16)==0;}
int TMd5Sig::operator[] ( const int &  CdN) const [inline]

Definition at line 103 of file md5.h.

                                       {
    Assert((0<=CdN)&&(CdN<16)); return CdT[CdN];}
void TMd5Sig::Save ( TSOut SOut) const [inline]

Definition at line 95 of file md5.h.

{SOut.SaveBf(CdT, 16);}

Member Data Documentation

uint1 TMd5Sig::CdT[16] [private]

Definition at line 84 of file md5.h.


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