| Package | calista.hash |
| Class | public final class Adler32 |
| Inheritance | Adler32 Object |
The Adler-32 checksum is part of the widely-used zlib compression library, as both were developed by Mark Adler.
Example :
package examples
{
import calista.hash.Adler32;
import flash.display.Sprite;
import flash.utils.ByteArray;
public class Adler32Example extends Sprite
{
public function Adler32Example()
{
var bytes:ByteArray = new ByteArray() ;
bytes.writeUTFBytes("Wikipedia") ;
var sum:uint = Adler32.checkSum(bytes) ;
trace("Adler32 : " + sum + " 0x" + sum.toString( 16 ).toUpperCase() ) ; // Adler32 : 300286872 0x11E60398
}
}
}
| Method | Defined By | ||
|---|---|---|---|
checkSum(buffer:ByteArray, index:uint = 0, length:uint = 0):uint [static]
Generates the checksum of the specified ByteArray with the Adler32 algorithm. | Adler32 | ||
| checkSum | () | method |
public static function checkSum(buffer:ByteArray, index:uint = 0, length:uint = 0):uintGenerates the checksum of the specified ByteArray with the Adler32 algorithm.
Parameters
buffer:ByteArray — the buffer ByteArray object which contains the datas.
| |
index:uint (default = 0) — The index to begin the buffering (default 0).
| |
length:uint (default = 0) — The length value to limit the buffering (if this value is 0, the length of the ByteArray is used).
|
uint |