I don't use your actual PHP code directly but ported it to another language, but it seems to me that
|
$n++; |
|
$val += $chars[$n]; |
should be the other way around: first read the character, then increment $n. As it stands now, it will never read the first character of the input string.
Or, in one line:
I don't use your actual PHP code directly but ported it to another language, but it seems to me that
base32/src/Base32.php
Lines 104 to 105 in e8b7d85
should be the other way around: first read the character, then increment
$n. As it stands now, it will never read the first character of the input string.Or, in one line: