-
Notifications
You must be signed in to change notification settings - Fork 26
Base64
Nick Ryzhy edited this page Apr 4, 2016
·
3 revisions
Encodes and decodes binary data using Base64 algorithm.
Name | Value |
---|---|
Package | by.blooddy.crypto |
Name | final class Base64 |
Inheritance |
Base64 → Process → EventDispatcher → Object
|
import by.blooddy.crypto.Base64;
var result:ByteArray = Base64.decode( 'ZWFzdXJlLg==' );
import by.blooddy.crypto.Base64;
import by.blooddy.crypto.events.ProcessEvent;
var base64:Base64 = new Base64();
base64.decode( 'ZWFzdXJlLg==' );
base64.addEventListener( ProcessEvent.COMPLETE, function(event:ProcessEvent):void {
var result:ByteArray = event.data;
trace( result ); // async result
} );
base64.addEventListener( ProcessEvent.ERROR, function(event:ProcessEvent):void {
var error:Error = event.data;
trace( error ); // async error
} );
Name | Description |
---|---|
isValid(str:String):Boolean |
Return true if str is valid Base64 string. |
encode(bytes:ByteArray, newLines:uint=0):String |
Encodes the ByteArray using Base64 encoding algorithm. |
decode(str:String):ByteArray |
Decodes the String previously encoded using Base64 algorithm. |
Name | Description |
---|---|
Base64() |
Creates a Base64 object. |
Name | Description |
---|---|
encode(bytes:ByteArray, newLines:uint=0):void |
Asynchronously encodes the ByteArray using Base64 encoding algorithm. Dispatched String result in ProcessEvent . |
decode(str:String):void |
Asynchronously decodes the String previously encoded using Base64 algorithm. Dispatched ByteArray result in ProcessEvent . |
Name | Type | Description |
---|---|---|
complete |
ProcessEvent | Dispatched when success. |
error |
ProcessEvent | Dispatched when fault. |