FUNCTIONS CORE

CharXOR()

Combine the characters of two strings with a binary XOR

Syntax

Signature
CharXOR( cString1, cString2 ) --> cResult

Arguments

cString1

cString2

Example

CharXOR.prg
PROCEDURE Main()

   LOCAL cKey    := "xDev"
   LOCAL cSecret := CharXOR( "Meet at noon", cKey )

   Check( 'CharXOR( cSecret, cKey )               ', CharXOR( cSecret, cKey ), "Meet at noon" )
   Check( 'cSecret == "Meet at noon"              ', cSecret == "Meet at noon", .F. )

RETURN

STATIC PROCEDURE Check( cTitle, xResult, xExpected )

   QOut( cTitle + IIF( xResult == xExpected, "OK", "ERROR" ) )

RETURN

Output

CharXOR( cSecret, cKey )               OK
cSecret == "Meet at noon"              OK