MCPcopy Create free account
hub / github.com/MaxBelkov/visualsyslog / FromHexMas

Function FromHexMas

sourcecommon/utils.cpp:474–489  ·  view source on GitHub ↗

---------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

472}
473//---------------------------------------------------------------------------
474bool FromHexMas(AnsiString s, void * data, int size)
475{
476 if( s.Length()<size*2 || !data || !size )
477 return false;
478
479 int index = 1;
480 for(int i=0; i<size; i++)
481 {
482 if( s.Length() < index+1 ) return false;
483 if( s[index] == ' ' ) { index++; i--; continue; }
484 if( ! IsHexDigit(s[index]) || ! IsHexDigit(s[index+1]) ) return false;
485 ((BYTE *)data)[i] = CharToDigit(s[index], s[index+1]);
486 index += 2;
487 }
488 return true;
489}
490//---------------------------------------------------------------------------
491String GetTimeString(TDateTime interval)
492{

Callers 1

UnsecurePasswordFunction · 0.85

Calls 2

IsHexDigitFunction · 0.85
CharToDigitFunction · 0.85

Tested by

no test coverage detected