Packagecom.adobe.crypto
Classpublic class MD5Stream

Perform MD5 hash of an input stream in chunks. This class is based on com.adobe.crypto.MD5 and can process data in chunks. Both block creation and hash computation are done together for whatever input is available so that the memory overhead at a time is always fixed. Memory usage is governed by two parameters: one is the amount of data passed in to update() and the other is memoryBlockSize. The latter comes into play only when the memory window exceeds the pre allocated memory window of flash player. Usage: create an instance, call update(data) repeatedly for all chunks and finally complete() which will return the md5 hash.



Public Properties
 PropertyDefined by
  memoryBlockSize : int = 16384
Change this value from the default (16384) in the range of MBs to actually affect GC as GC allocates in pools of memory
MD5Stream
Public Methods
 MethodDefined by
  
MD5Stream
  
complete(input:ByteArray = null):String
Pass in chunks of the input data with update(), call complete() with an optional chunk which will return the final hash.
MD5Stream
  
resetFields():void
Re-initialize this instance for use to perform hashing on another input stream.
MD5Stream
  
update(input:ByteArray):void
Pass in chunks of the input data with update(), call complete() with an optional chunk which will return the final hash.
MD5Stream
Property detail
memoryBlockSizeproperty
public var memoryBlockSize:int = 16384

Change this value from the default (16384) in the range of MBs to actually affect GC as GC allocates in pools of memory

Constructor detail
MD5Stream()constructor
public function MD5Stream()
Method detail
complete()method
public function complete(input:ByteArray = null):String

Pass in chunks of the input data with update(), call complete() with an optional chunk which will return the final hash. Equivalent to the way java.security.MessageDigest works.

Parameters
input:ByteArray (default = null) — The optional bytearray chunk which is the final part of the input

Returns
String — A string containing the hash value
resetFields()method 
public function resetFields():void

Re-initialize this instance for use to perform hashing on another input stream. This is called automatically by complete().

update()method 
public function update(input:ByteArray):void

Pass in chunks of the input data with update(), call complete() with an optional chunk which will return the final hash. Equivalent to the way java.security.MessageDigest works.

Parameters
input:ByteArray — The bytearray chunk to perform the hash on