Вверх ↑
Ответов: 4621
Рейтинг: 746
#1: 2019-07-15 10:47:07 ЛС | профиль | цитата

function Int64ToHex(Value: Int64; Digits: Integer): string;
const
HexDigitChr: array[0..15] of Char = ( '0','1','2','3','4','5','6','7',
'8','9','A','B','C','D','E','F' );
var
Buf: array[0..16] of Char;
Dest : PChar;
begin
Dest := @Buf[16];
Dest^ := #0;
repeat
Dec(Dest);
Dest^ := '0';
if Value <> 0 then
begin
Dest^ := HexDigitChr[Value and $F];
Value := Value shr 4;
end;
Dec(Digits);
until (Value = 0) and (Digits <= 0);
Result := Dest;
end;
карма: 26

0