TBase64
Encode/Decode Base64 data.
Functions
Function Encode:String(source:Byte[], offset:Int = 0, options:EBase64Options = EBase64Options.None)
Encodes byte array data source to a Base64 encoded String, starting at offset.
Example
SuperStrict
Framework brl.standardio
Import brl.base64
Local someData:String = "Hello BlitzMax World!"
Local encoded:String = TBase64.Encode(someData.ToUTF8String(), someData.length)
Print "Encoded : " + encoded
Function Encode:String(source:Byte Ptr, length:Int, offset:Int = 0, options:EBase64Options = EBase64Options.None)
Encodes byte data source to a Base64 encoded String, starting at offset and of length bytes.
Example
SuperStrict
Framework brl.standardio
Import brl.base64
Local someData:String = "Hello BlitzMax World!"
Local encoded:String = TBase64.Encode(someData.ToUTF8String(), someData.length)
Print "Encoded : " + encoded
Function Decode:Byte[]( source:String, offset:Int = 0, options:EBase64Options = EBase64Options.None )
Decodes Base64 encoded String source to an array of Bytes, starting at offset.
Example
SuperStrict
Framework brl.standardio
Import brl.base64
Local encodedData:String = "SGVsbG8gQmxpdHpNYXggV29ybGQh"
Local data:Byte[] = TBase64.Decode(encodedData)
Local decoded:String = String.FromUTF8String(data)
Print "Decoded : " + decoded