My favorites | Sign in
Project Logo
                
Search
for
Updated Jun 22, 2008 by woollybah
Labels: Base64
Base64Module  
Base64 Encoder/Decoder

Introduction

Based on Robert Harder's Java encoder/decoder.

Allows you to Base64 encode byte data to a String, and decode from an encoded String to byte data.

Handy if you need to embed some binary data in plain-text.

Example

Encoding

SuperStrict
Import BaH.Base64

Local someData:String = "Woo! BlitzMax Modules rock!"
Local encoded:String = TBase64.Encode(someData, someData.length)
Print "Encoded : " + encoded

Decoding

SuperStrict
Import BaH.Base64

Local encodedData:String = "V29vISBCbGl0ek1heCBNb2R1bGVzIHJvY2sh"
Local data:Byte[] = TBase64.Decode(encodedData)
Local decoded:String = String.FromBytes(data, data.length)
Print "Decoded : " + decoded

Building

See HowToInstallModules to help you get started.


Sign in to add a comment
Hosted by Google Code