Skip to content
Nick Ryzhy edited this page Apr 4, 2016 · 4 revisions

Generates a CRC-32 (Cyclic Redundancy Check) checksum.

Name Value
Package by.blooddy.crypto
Name final class CRC32
Inheritance CRC32ProcessEventDispatcherObject

Examples

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

var crc32:CRC32 = new CRC32();
crc32.hash( 'text' );
crc32.addEventListener( ProcessEvent.COMPLETE, function(event:ProcessEvent):void {
	var result:uint = event.data;
	trace( result ); // async result
} );
crc32.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
CRC32() Creates a CRC32 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