X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=Uplink%2FNumerics.class.php;h=943fc15ee365a6e6ba8192b1d8c0f87a7e3df426;hb=d1fc76f5af98ff28ca6405cc5d6f50a3bbf0ac9b;hp=01944dcb9aa6d42776c97e38593287fcc10fefb0;hpb=f1a1066826a5cc04606cc12f0bd0b8e0383ca190;p=PHP-P10.git diff --git a/Uplink/Numerics.class.php b/Uplink/Numerics.class.php index 01944dc..943fc15 100644 --- a/Uplink/Numerics.class.php +++ b/Uplink/Numerics.class.php @@ -50,9 +50,6 @@ class Numerics { private static $base64charsLength = 64; public static function intToNum($int, $length) { - //fix a small "bug": normaly 0 = AAAAA but we need 1 = AAAAA - $int = $int - 1; - $numeric = ""; for($pos = $length-1; $pos >= 0; $pos--) { //current position represents floor($int / ($base64charsLength ^ $pos)) @@ -61,6 +58,7 @@ class Numerics { $base = $base * self::$base64charsLength; } $posValue = floor($int / $base); + $int -= $posValue * $base; //get the char representing $posValue $posChar = self::$base64chars[$posValue]; $numeric .= $posChar; @@ -77,10 +75,6 @@ class Numerics { $int = ($posValue * $base); $base = $base * self::$base64charsLength; } - - //fix a small "bug": normaly 0 = AAAAA but we need 1 = AAAAA - $int = $int + 1; - return $int; }