Xbase++
Xbase++
Base64 Encode/Decode a String
See more Encryption Examples
_LANGUAGE_ example to base-64 encode and decode a string.Chilkat Xbase++ Downloads
LOCAL nSuccess
LOCAL oBd
LOCAL s
LOCAL cStrBase64
LOCAL oBd2
LOCAL cDecoded
nSuccess := 0
oBd := CreateObject("Chilkat.BinData")
s := "A friend called me up the other day and talked about investing in a dot-com that sells lobsters. Internet lobsters. Where will this end? --Donald Trump"
nSuccess := oBd:AppendString(s, "utf-8")
cStrBase64 := oBd:GetEncoded("base64")
? cStrBase64
// To decode:
oBd2 := CreateObject("Chilkat.BinData")
oBd2:AppendEncoded(cStrBase64, "base64")
cDecoded := oBd2:GetString("utf-8")
? cDecoded
oBd:destroy()
oBd2:destroy()