Internet Direct (Indy)
Home
PreviousUpNext
IdHexDigits Constant

Identifies characters used in the hexadecimal representation of a numeric value.

Pascal
IdHexDigits: array [0..15] of AnsiChar = ('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');

IdHexDigits is a constant array containing valid characters that can be used in the hexadecimal representation of a numeric value. IdHexDigits characters can be accessed by an index value that corresponds to the decimal value for the hexadecimal character. 

IdHexDigits is used in the ByteToHex function to access the string representation for each nibble in the byte.

[Delphi] IdHexDigits, ByteToHex 

 

  function ByteToHex(const AByte : Byte) : shortstring;
  begin
    SetLength(Result, 2);
    Result[1] := IdHexDigits[AByte shr 4];
    Result[2] := IdHexDigits[AByte and $0F];
  end;
Internet Direct (Indy) version 10.1.5
Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Website http://www.indyproject.org.
Post feedback to the Indy Documentation newsgroup.