Skip to content

Incrementing $n in the wrong order? #35

Description

@deakjahn

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

$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:

$val += $chars[$n++];

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions