Encoding

Encoding & Hashing


EHashAlgo

type EHashAlgo = enum(SHA1, SHA256, SHA384, SHA512, MD5);

Note

This enum is scoped, so must be used like EHashAlgo.SHA512


EBaseEncoding

type EBaseEncoding = enum(b64URL, b64, b32, b32Hex, b16);

Note

This enum is scoped, so must be used like EBaseEncoding.b64


HashData

function HashData(Algo: EHashAlgo; Buf: PByte; Len: Int32): String;

HashString

function HashString(Algo: EHashAlgo; S: String): String;

HashFile

function HashFile(Algo: EHashAlgo; FileName: String): String;

Hash32

function Hash32(Data: Pointer; Len: Int32; Seed: UInt32 = 0): UInt32;

Hash32

function Hash32(S: String; Seed: UInt32 = 0): UInt32;

Hash64

function Hash64(Data: PByte; Len: Int32; Seed: UInt64 = 0): UInt64;

Hash64

function Hash64(S: String; Seed: UInt64 = 0): UInt64;

BaseEncode

function BaseEncode(Encoding: EBaseEncoding; const Data: String): String;

BaseDecode

function BaseDecode(Encoding: EBaseEncoding; const Data: String): String;

HOTPCalculateToken

function HOTPCalculateToken(const Secret: String; const Counter: Integer): Integer;

TOTPCalculateToken

function TOTPCalculateToken(const Secret: String): Integer;

CompressBytes

function CompressBytes(Bytes: TByteArray): TByteArray;

Note

Zlib compression is used.


DecompressBytes

function DecompressBytes(Bytes: TByteArray): TByteArray;

Note

Zlib compression is used.


CompressString

function CompressString(Data: String; Encoding: EBaseEncoding = EBaseEncoding.b64): String;

Note

Zlib compression is used.


DecompressBytes

function DeCompressString(Data: String; Encoding: EBaseEncoding = EBaseEncoding.b64): String;

Note

Zlib compression is used.


FastCompress

function FastCompress(Src: Pointer; Size: Integer; Dest: Pointer): Integer;

FastDecompress

function FastDecompress(Src: Pointer; Size: Integer; Dest: Pointer): Integer;

FastCompressDestLen

function FastCompressDestLen(Len: Integer): Integer;

FastDecompressDestLen

function FastDecompressDestLen(Src: Pointer): Integer;

FastCompressImage

procedure FastCompressImages(Images: TSimbaImageArray; var Data: Pointer; out DataSize: SizeUInt);

FastDecompressImages

function FastDecompressImages(Data: Pointer; DataLen: SizeUInt): TSimbaImageArray;

TExternalCanvas.Width

property TExternalCanvas.Width: Integer;


TExternalCanvas.Height

property TExternalCanvas.Height: Integer;


TExternalCanvas.GetDefaultPixel

function TExternalCanvas.GetDefaultPixel: TColorBGRA;


TExternalCanvas.SetDefaultPixel

procedure TExternalCanvas.SetDefaultPixel(Value: TColorBGRA);


TExternalCanvas.GetFontName

> function TExternalCanvas.GetFontName: String;

-----

TExternalCanvas.SetFontName

procedure TExternalCanvas.SetFontName(Value: String);


TExternalCanvas.GetFontSize

> function TExternalCanvas.GetFontSize: Single;

-----

TExternalCanvas.SetFontSize

procedure TExternalCanvas.SetFontSize(Value: Single);


TExternalCanvas.GetFontAntialiasing

> function TExternalCanvas.GetFontAntialiasing: Boolean;

-----

TExternalCanvas.SetFontAntialiasing

procedure TExternalCanvas.SetFontAntialiasing(Value: Boolean);


TExternalCanvas.GetFontBold

> function TExternalCanvas.GetFontBold: Boolean;

-----

TExternalCanvas.SetFontBold

procedure TExternalCanvas.SetFontBold(Value: Boolean);


TExternalCanvas.GetFontItalic

> function TExternalCanvas.GetFontItalic: Boolean;

-----

TExternalCanvas.SetFontItalic

procedure TExternalCanvas.SetFontItalic(Value: Boolean);


TExternalCanvas.TextWidth

> function TExternalCanvas.TextWidth(Text: String): Integer;

-----

TExternalCanvas.TextHeight

function TExternalCanvas.TextHeight(Text: String): Integer;


TExternalCanvas.TextSize

> function TExternalCanvas.TextSize(Text: String): TPoint;

-----

TExternalCanvas.GetAlpha
-----------------------
> function TExternalCanvas.GetAlpha(X, Y: Integer): Byte;

-----

TExternalCanvas.SetAlpha
-----------------------
> procedure TExternalCanvas.SetAlpha(X, Y: Integer; Alpha: Byte);

-----

TExternalCanvas.GetPixel
-----------------------
> function TExternalCanvas.GetPixel(X, Y: Integer): TColor;

-----

TExternalCanvas.SetPixel
-----------------------
> procedure TExternalCanvas.SetPixel(X, Y: Integer; Color: TColor);

-----

TExternalCanvas.SetPixels
------------------------
> procedure TExternalCanvas.SetPixels(Points: TPointArray; Color: TColor);

-----

TExternalCanvas.SetPixels
------------------------
> procedure TExternalCanvas.SetPixels(Points: TPointArray; Colors: TColorArray);

-----

TExternalCanvas.GetDrawColor
---------------------------
> function TExternalCanvas.GetDrawColor: TColor;

Returns the current drawing color.

```{note}
Red is the default value.
```

-----

TExternalCanvas.SetDrawColor
---------------------------
> procedure TExternalCanvas.SetDrawColor(Color: TColor);

Sets the current draw color.

```{note}
Red is the default value.
```

-----

TExternalCanvas.GetDrawAlpha
---------------------------
> function TExternalCanvas.GetDrawAlpha: Byte;

Returns the current draw alpha.
0 is completely transparent and 255 is completely opauge.

```{note}
255 is the default value.
```

-----

TExternalCanvas.SetDrawAlpha
---------------------------
> procedure TExternalCanvas.SetDrawAlpha(Value: Byte);

Sets the current draw color. This determines how transparent something is drawn.

```{note}
255 is the default value.
```

-----

TExternalCanvas.DrawText

procedure TExternalCanvas.DrawText(Text: String; Position: TPoint);


TExternalCanvas.DrawText

> procedure TExternalCanvas.DrawText(Text: String; Box: TBox; Alignments: EImageTextAlign);

-----

TExternalCanvas.DrawTextLines

procedure TExternalCanvas.DrawTextLines(Text: TStringArray; Position: TPoint);