Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosHe committed Mar 3, 2023
1 parent 2e45888 commit 450a457
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions src/Horse.JWT.pas
Expand Up @@ -8,7 +8,6 @@ interface

uses
{$IF DEFINED(FPC)}
Generics.Collections,
Classes,
fpjson,
SysUtils,
Expand Down Expand Up @@ -126,20 +125,20 @@ procedure Middleware(AHorseRequest: THorseRequest; AHorseResponse: THorseRespons
{$IF DEFINED(FPC)}
function HexToAscii(const HexStr: string): AnsiString;
var
B: Byte;
Cmd: string;
I, L: Integer;
LByte: Byte;
LCmd: string;
LLength: Integer;
LIndex: Integer;
begin
Result := '';
Cmd := Trim(HexStr);
I := 1;
L := Length(Cmd);

while I < L do
LCmd := Trim(HexStr);
LIndex := 1;
LLength := Length(LCmd);
while LIndex < LLength do
begin
B := StrToInt('$' + copy(Cmd, I, 2));
Result := Result + AnsiChar(chr(B));
Inc(I, 2);
LByte := StrToInt('$' + copy(LCmd, LIndex, 2));
Result := Result + AnsiChar(chr(LByte));
Inc(LIndex, 2);
end;
end;

Expand Down

0 comments on commit 450a457

Please sign in to comment.