-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdebugutils.pas
46 lines (33 loc) · 929 Bytes
/
debugutils.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
unit debugUtils;
{$mode ObjFPC}{$H+}
interface
uses
Classes, SysUtils;
type
TByteArr = array of byte;
PTByteArr = ^TByteArr;
function ByteArrayToHexString(AByteArray: array of byte; ASep: string = ''): string;
implementation
function ByteArrayToHexString(AByteArray: array of byte; ASep: string = ''): string;
var
i, k: integer;
begin
result := '';
if ASep = '' then begin
for i := low(AByteArray) to high(AByteArray) do
result := result + IntToHex(AByteArray[i], 2);
end else begin
k := high(AByteArray);
for i := low(AByteArray) to k do begin
result := result + IntToHex(AByteArray[i], 2);
if k <> i then result := result + ASep;
end;
end;
end;
{function ByteArrayToHexString(P_STATIC_byte_array : Pointer; Buffer_size : integer; ASep: string = ''): string; overload;
var PBA : PTByteArr;
BA : TByteArr;
begin
ByteArrayToHexString
end; }
end.