FreenetIS
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Public Attributes | List of all members
Checksum_Variable_Key_Generator Class Reference

Generates variable keys with chacksum. More...

Inheritance diagram for Checksum_Variable_Key_Generator:
Variable_Key_Generator

Public Member Functions

 generate ($identificator)
 Generated variable key from given member ID.
 errorCheckAvailable ()
 Is generator capable of error checking.
 errorCheck ($var_key)
 If errorCheckAvailable() is TRUE that this method may be used for error detection.
 errorCorrectionAvailable ()
 Is generator capable of error correction.
 errorCorrection ($var_key)
 If errorCorrectionAvaiable() is TRUE than this method may be used for error correction of the variable symbol.

Public Attributes

const PARITY_SEED = 'variable_symbol_checksum_generator_seed'
- Public Attributes inherited from Variable_Key_Generator
const DIR = 'variable_key_generators'
 Dir with classes.

Additional Inherited Members

- Static Public Member Functions inherited from Variable_Key_Generator
static factory ($driver=NULL)
 Factory for Variable key drivers.
static get_driver_name ($driver)
 Gets name of driver.
static get_drivers ()
 Gets drivers array.
static get_drivers_for_dropdown ()
 Gets drivers array for dropdown.
static get_active_driver ()
 Gets list of active drivers for selectboxes.

Detailed Description

Generates variable keys with chacksum.

Generator sums identificator with seed saved in database and appends its checksum.

Author
David Raska

Member Function Documentation

Checksum_Variable_Key_Generator::errorCheck (   $var_key)

If errorCheckAvailable() is TRUE that this method may be used for error detection.

It is only capable of detection, no correction is available here.

Override this method in a subclass in order to implement error detection for your generator.

Parameters
string$var_keyVariable key
Returns
boolean TRUE is the given variable key is without errors or FALSE otherwise

Reimplemented from Variable_Key_Generator.

Checksum_Variable_Key_Generator::errorCheckAvailable ( )

Is generator capable of error checking.

Returns
boolean

Reimplemented from Variable_Key_Generator.

Checksum_Variable_Key_Generator::errorCorrection (   $var_key)

If errorCorrectionAvaiable() is TRUE than this method may be used for error correction of the variable symbol.

Override this method in a subclass in order to implement error correction for your generator.

Parameters
string$var_keyVariable key
Returns
array Contains two items boolean status TRUE if correction was successful FALSE if correction was unsuccessful string corrected_variable_key Corrected variable symbol

Reimplemented from Variable_Key_Generator.

Checksum_Variable_Key_Generator::errorCorrectionAvailable ( )

Is generator capable of error correction.

Returns
boolean

Reimplemented from Variable_Key_Generator.

Checksum_Variable_Key_Generator::generate (   $identificator)

Generated variable key from given member ID.

Parameters
mixed$identificatorIndentificator for generate from
Returns
integer Variable key

Reimplemented from Variable_Key_Generator.


The documentation for this class was generated from the following file: