Convert Byte to HEX string
function ByteToHex(InByte:byte):shortstring;
const Digits:array[0..15] of char='0123456789ABCDEF';
begin
result:=digits[InByte shr 4]+digits[InByte and $0F];
end;
Description
This is a function that converts a Byte into a string containing the number's hexadecimal (base 16) representation.InByte is the number which we want to convert.
Example :
the result
MyHex is "FF".
the result
MyHex is "FF".
the result
MyHex is "55".
|