-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathHex.int.inc
49 lines (43 loc) · 2.08 KB
/
Hex.int.inc
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
46
47
48
{******************************************************************************}
{* Hex.int.inc *}
{* Revolutionary Confederation of Anarcho Syndicalists *}
{* Written by: black.rabbit 2011 *}
{******************************************************************************}
{ ôóíêöèè äëÿ ðàáîòû ñ 16-ðè÷íûìè äàííûìè }
type
Hex = String;
const
{$IFDEF HEX_UPPER_CASE}
HexChars : array [0..15] of Char = (
'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'
);
HexSymbols : ShortString = '0123456789ABCDEF';
{$ELSE}
HexChars : array [0..15] of Char = (
'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'
);
HexSymbols : ShortString = '0123456789abcdef';
{$ENDIF}
function IntToHex (Int: Int64; IntSize: Byte) : Hex;
function FloatToHex (const aValue: Extended; Size: Byte) : Hex;
function StrToHex (const aValue: String) : Hex;
function DateTimeToHex (const aValue: TDateTime) : Hex;
function VersionInfoToHex (const aValue: TVersionInfo) : Hex;
function HexToInt (const aValue: Hex) : Int64;
function HexToFloat (const aValue: Hex) : Extended;
function HexToStr (const aValue: Hex) : String;
function HexToDateTime (const aValue: Hex) : TDateTime;
function HexToVersionInfo (const aValue: Hex) : TVersionInfo;
function IsHex (const aValue: String) : Boolean;
procedure StreamToHexStream (const anInput: TStream;
out anOutput: TStream;
const aBlockSize: WORD = 1024);
procedure HexStreamToStream (const anInput: TStream;
out anOutput: TStream;
const aBlockSize: WORD = 1024);
procedure ByteStreamToHexStream (const anInput: TStream;
out anOutput: TStream);
procedure HexStreamToByteStream (const anInput: TStream;
out anOutput: TStream);
function IsHexStream (const aStream: TStream;
const aBlockSize: WORD = 1024) : Boolean;