Packagecom.whirled.contrib.hackproof
Classpublic class HPUInt
InheritanceHPUInt Inheritance flash.events.EventDispatcher

This class holds an unsigned integer value. From the point of view of the programmer, it should work just like a normal uint, except that it needs to be accessed using the "value" member and it will dispatch a HackDetected event if the value is tampered with externally.

Also, HPUInts will not have all of their parts garbage collected, so if a large number of them are used in a program, memory leakage will occur. If you need to use HPUInts in disposable objects, it is recommended that you use the HPReuseManager to allocate and deallocate HPUInts as needed.

Here's how HPUInt works:
The value is actually stored as the difference of two numbers, one of which is generated randomly. As a result, the stored value will not appear in memory anywhere. It also stores a checksum in a separate location.



Public Properties
 PropertyDefined by
  value : uint
Contains the value.
HPUInt
Public Methods
 MethodDefined by
  
Creates a new HPUInt with the default value of 0.
HPUInt
  
checkIntegrity():Boolean
Although each HPInt is checked each time it is read or written, this function can be used to check that it hasn't been modified at other times.
HPUInt
  
verifyAll():Boolean
[static] Used to verify the master checksum for HPIInt.
HPUInt
Property detail
valueproperty
value:uint  [read-write]

Contains the value.

Implementation
    public function get value():uint
    public function set value(value:uint):void
Constructor detail
HPUInt()constructor
public function HPUInt()

Creates a new HPUInt with the default value of 0.

Method detail
checkIntegrity()method
public function checkIntegrity():Boolean

Although each HPInt is checked each time it is read or written, this function can be used to check that it hasn't been modified at other times. Calling this is never necessary.

Returns
Boolean
verifyAll()method 
public static function verifyAll():Boolean

Used to verify the master checksum for HPIInt. This should be called every once and a while if you want to be certain that freezing attacks are not occuring.

Returns
Boolean