XORStr function
Return to Introduction  Previous page  Next page
Unit
acUtils  

Declaration
function XORStr(Str: String; XORByte: Byte);  

Description
XORStr is VERY simple crypting routine. It just XOR's every character of string, specified in Str parameter, to the byte, specified in XORByte parameter.  

Original code
function XORStr(Str: String; XORByte: Byte): String;  
var  
  I: Integer;  
begin  
  Result := Str;  
 
  I := Length(Str);  
  if I <> 0 then  
   for I := 1 to I do  
    Result[I] := Char(Byte(Str[I]) xor XORByte);  
end;