Skip to content

Adler32

Nick Ryzhy edited this page Apr 4, 2016 · 3 revisions

Generates a Adler-32 checksum.

Name Value
Package by.blooddy.crypto
Name final class Adler32
Inheritance Adler32ProcessEventDispatcherObject

Examples

Sync
import by.blooddy.crypto.Adler32;
var result:uint = Adler32.hash( 'text' );
Async
import by.blooddy.crypto.Adler32;
import by.blooddy.crypto.events.ProcessEvent;

var adler32:Adler32 = new Adler32();
adler32.hash( 'text' );
adler32.addEventListener( ProcessEvent.COMPLETE, function(event:ProcessEvent):void {
	var result:uint = event.data;
	trace( result ); // async result
} );
adler32.addEventListener( ProcessEvent.ERROR, function(event:ProcessEvent):void {
	var error:Error = event.data;
	trace( error ); // async error
} );

Static Methods

Name Description
hash(str:String):uint Performs checksum algorithm on a String. Return a uint containing the checksum value of str.
hashBytes(bytes:ByteArray):uint Performs checksum algorithm on a ByteArray. Return a uint containing the checksum value of bytes.

Constructor

Name Description
Adler32() Creates a Adler32 object.

Methods

Name Description
hash(str:String):void Asynchronously performs checksum algorithm on a String. Dispatched uint result in ProcessEvent.
hashBytes(bytes:ByteArray):void Asynchronously performs checksum algorithm on a ByteArray. Dispatched uint result in ProcessEvent.

Events

Name Type Description
complete ProcessEvent Dispatched when success.
error ProcessEvent Dispatched when fault.

Hashsum

Checksum

Image

Serialization

Clone this wiki locally