function xxx(S: string): string;
var
i: Integer;
const
LowCharChange: array[0..15] of Char = ('9','8','B','A','D','C','F','E','1','0','3','2','5','4','7','6');
HighCharChange: array[0..15] of Char = ('8','9','A','B','C','D','E','F','0','1','2','3','4','5','6','7');
function CharToID(AChar: Char): Integer;
begin
Result := -1;
if AChar in ['0'..'9'] then
Result := StrToInt(AChar)
else if AChar in ['A'..'F'] then
Result := Ord(AChar) - Ord('A') + 10;
end;
begin
for i := 1 to Length(s) do
begin
if Odd(i) then
s := HighCharChange[CharToID(s)]
else s := LowCharChange[CharToID(s)];
end;
Result := RightStr(tmpStr, 2) + Copy(tmpStr, 5, 2) + Copy(tmpStr, 3, 2) + LeftStr(tmpStr, 2);
end;
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
ShowMessage(xxx('F1836A8C'));
end;