help files
Z505 | PasWiki | FUQ | Search | Main Docs | API Guide



[Overview][Constants][Types][Procedures and functions] Reference for unit 'strutils' (#rtl)

XorString

Encode a string by XOR-ing its characters using characters of a given key.

Declaration

Source position: strutils.pp line 159

function XorString(

  const Key: ShortString;

  const Src: ShortString

):ShortString;

Arguments

Key

  

Key to use

Src

  

String to encode.

Function result

Resulting string

Description

XorString encodes the string Src by XOR-ing each character in Source with the corresponding character in Key, repeating Key as often as necessary. The resulting string may contain unreadable characters and may even contain null characters. For this reason it may be a better idea to use the XorEncode function instead, which will representing each resulting ASCII code as a hexadecimal number (of length 2).

Feeding the result again to XorString with the same Key, will result in the original string Src.

Errors

None.

See also

XorEncode

  

Encode a string by XOR-ing its characters using characters of a given key, representing the result as hex values.

XorDecode

  

Decode a string encoded with XorEncode

Notes

 No notes exist for this page yet. 





lufdoc, Powtils, fpc, freepascal, delphi, kylix, c/c++, mysql, cgi web framework docs, Z505