Sample code for 30+ languages & platforms
Go

Obfuscate String

Demonstrates how to obfuscate and unobfuscate a string.

Chilkat Go Downloads

Go
    success := false

    sb := chilkat.NewStringBuilder()

    s := "Hello World!"

    sb.Append(s)
    fmt.Println(*sb.GetAsString())

    // Output is "Hello World!";

    // Obfuscate the string.
    // This is NOT encryption.  It's just a simple obfuscation.
    sb.Obfuscate()
    fmt.Println(*sb.GetAsString())

    // Output is 2GsgGhbSQVyG8Vb9

    // -------------------------
    // Unobfuscate.
    sb2 := chilkat.NewStringBuilder()
    s2 := "2GsgGhbSQVyG8Vb9"
    sb2.Append(s2)
    sb2.Unobfuscate()

    fmt.Println(*sb2.GetAsString())

    // Output is "Hello World!";

    sb.DisposeStringBuilder()
    sb2.DisposeStringBuilder()