Sample code for 30+ languages & platforms
PureBasic

Example: Crypt2.DecodeString method

Demonstrates how to call the DecodeString method.

Chilkat PureBasic Downloads

PureBasic
IncludeFile "CkCrypt2.pb"

Procedure ChilkatExample()

    crypt2.i = CkCrypt2::ckCreate()
    If crypt2.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    ; The string "Hello World" in base64 (using the utf-8 byte representation) is "SGVsbG8gV29ybGQ="

    encodedStr.s = "SGVsbG8gV29ybGQ="
    encoding.s = "base64"
    charset.s = "utf-8"

    str.s = CkCrypt2::ckDecodeString(crypt2,encodedStr,charset,encoding)
    Debug str

    ; Output is "Hello World"


    CkCrypt2::ckDispose(crypt2)


    ProcedureReturn
EndProcedure