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

Function CharToDigit

sourcecommon/utils.cpp:449–460  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

447}
448//---------------------------------------------------------------------------
449BYTE CharToDigit(char ch, char cl)
450{
451 BYTE rv = 0;
452 if( ch>='0' && ch<='9' ) rv += (BYTE)((ch-'0')<<4);
453 else if( ch>='A' && ch<='F' ) rv += (BYTE)((ch-'A'+0x0A)<<4);
454 else if( ch>='a' && ch<='f' ) rv += (BYTE)((ch-'a'+0x0A)<<4);
455
456 if( cl>='0' && cl<='9' ) rv += (BYTE)(cl-'0');
457 else if( cl>='A' && cl<='F' ) rv += (BYTE)(cl-'A'+0x0A);
458 else if( cl>='a' && cl<='f' ) rv += (BYTE)(cl-'a'+0x0A);
459 return rv;
460}
461//---------------------------------------------------------------------------
462AnsiString ToHexMas(void * data, int size)
463{

Callers 1

FromHexMasFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected