anchor.diff:  { GLOBAL HELPER FUNCTIONS }
   
   function String2Hex(const Buffer: String): String;
  -function Hex2Bytes(const AHexString: String): TBytes; overload;
  -function TryHex2Bytes(const AHexString: String; out ABytes : TBytes): boolean; overload;
  +//function Hex2Bytes(const AHexString: String): TBytes; overload;
  +//function TryHex2Bytes(const AHexString: String; out ABytes : TBytes): boolean; overload;
   function Bytes2Hex(const ABytes: TBytes; AUsePrefix : boolean = false) : String;
   function BinStrComp(const Str1, Str2 : String): Integer; // Binary-safe StrComp replacement. StrComp will return 0 for when str1 and str2 both start with NUL character.
   function BytesCompare(const ABytes1, ABytes2: TBytes): integer;
  
positive.code:     Result := AnsiLowerCase(Result + IntToHex(Ord(Buffer[n]), 2));
  end;
  
  function Hex2Bytes(const AHexString: String): TBytes;
  begin
    if NOT TryHex2Bytes(AHexString, Result) then
      raise EArgumentOutOfRangeException.Create('Invalidly formatted hexadecimal string.');
  end;
  
  function TryHex2Bytes(const AHexString: String; out ABytes : TBytes): boolean; overload;
  var
    P : PAnsiChar;
    LHexString : String;
  
negative.code:   SetLength(ABytes, 0);
    LHexLength := System.Length(AHexString);
    LHexStart := 1;
    if {$IFDEF FPCAnsiStartsText{$ELSEStartsText{$ENDIF('0x', AHexString) then begin
  
      // Special case: 0x0 = empty byte array
      if (LHexLength = 3) AND (AHexString[3] = '0') then
  