(Visual FoxPro) Obfuscate String
Demonstrates how to obfuscate and unobfuscate a string.
LOCAL loSb
LOCAL lnSuccess
LOCAL s
LOCAL loSb2
LOCAL lcS2
* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.StringBuilder')
loSb = CreateObject('Chilkat.StringBuilder')
s = "Hello World!"
loSb.Append(s)
? loSb.GetAsString()
* Output is "Hello World!";
* Obfuscate the string.
* This is NOT encryption. It's just a simple obfuscation.
loSb.Obfuscate()
? loSb.GetAsString()
* Output is 2GsgGhbSQVyG8Vb9
* -------------------------
* Unobfuscate.
* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.StringBuilder')
loSb2 = CreateObject('Chilkat.StringBuilder')
lcS2 = "2GsgGhbSQVyG8Vb9"
loSb2.Append(lcS2)
loSb2.Unobfuscate()
? loSb2.GetAsString()
* Output is "Hello World!";
RELEASE loSb
RELEASE loSb2
|