Packagecalista.hash
Classpublic final class Adler32
InheritanceAdler32 Inheritance Object

Adler-32 is a modification of the Fletcher checksum.

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
             }
         }
     }
     



Public Methods
 MethodDefined By
  
checkSum(buffer:ByteArray, index:uint = 0, length:uint = 0):uint
[static] Generates the checksum of the specified ByteArray with the Adler32 algorithm.
Adler32
Method Detail
checkSum()method
public static function checkSum(buffer:ByteArray, index:uint = 0, length:uint = 0):uint

Generates 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).

Returns
uint