From: Jerome Jutteau Date: Thu, 21 Feb 2013 16:39:51 +0000 (+0000) Subject: Fix base 16 to 64 conversion X-Git-Tag: 1.1~209 X-Git-Url: https://git.p6c8.net/jirafeau_mojo42.git/commitdiff_plain/13e2e31c60052e3572ad1bb091bf81ae62f00aca?ds=inline;hp=8adcdf2e61aa2746235d99202ad07b59d0198b04 Fix base 16 to 64 conversion --- diff --git a/lib/functions.php b/lib/functions.php index 223fd8e..868d76e 100755 --- a/lib/functions.php +++ b/lib/functions.php @@ -60,8 +60,8 @@ base_16_to_64 ($num) $i = 0; # Convert long hex string to bin. $size = strlen ($num); - - $b .= $hex2bin{hexdec ($num{$i})}; + for ($i = 0; $i < $size; $i++) + $b .= $hex2bin{hexdec ($num{$i})}; # Convert long bin to base 64. $size *= 4; for ($i = $size - 6; $i >= 0; $i -= 6)