Packagecom.whirled.contrib.hackproof
Classpublic class HPBoolean
InheritanceHPBoolean Inheritance flash.events.EventDispatcher

This class holds a boolean (true/false) value. From the point of view of the programmer, it should work just like a normal Boolean, 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, HPBooleanss 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 HPBooleans in disposable objects, it is recommended that you use the HPReuseManager to allocate and deallocate HPBooleans as needed.

Here's how HPBoolean works:
The value is actually stored as whether or not one number is larger than another, with both numbers being 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 : Boolean
Contians the boolean value.
HPBoolean
Public Methods
 MethodDefined by
  
Creates a new HPBoolean with the default value of false.
HPBoolean
  
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.
HPBoolean
  
verifyAll():Boolean
[static] Used to verify the master checksum for HPBoolean.
HPBoolean
Property detail
valueproperty
value:Boolean  [read-write]

Contians the boolean value.

Implementation
    public function get value():Boolean
    public function set value(value:Boolean):void
Constructor detail
HPBoolean()constructor
public function HPBoolean()

Creates a new HPBoolean with the default value of false.

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 HPBoolean. This should be called every once and a while if you want to be certain that freezing attacks are not occuring.

Returns
Boolean