A Reversible Encryption Routine for PHP
By Tony Marston2005-04-15
The ApplyFudgeFactor function
function _applyFudgeFactor (&$fudgefactor)Here we extract the first entry in the array and remove it from the array.
{
$fudge = array_shift($fudgefactor);Next we add in the optional $adj value and put the result back into the end of the array.
$fudge = $fudge + $this->adj;If a $modulus value has been supplied we use it and possibly reverse the sign on the output value.
$fudgefactor[] = $fudge;
if (!empty($this->mod)) { // if modifier has been supplied
if ($fudge % $this->mod == 0) { // if it is divisible by modifier
$fudge = $fudge * -1; // reverse then sign
} // if
} // ifThere is no more 'fudging' left to do, so we can return the value to the calling process.
return $fudge;
} // _applyFudgeFactor
|
|||||||||
You might also want to check these out:
|
Leave a Comment on "A Reversible Encryption Routine for PHP"
You must be logged in to post a comment.
Link to This Tutorial Page!

