Skip to content

Correct and optimize custom-radix digit validation #187

Description

@timfennis

Problem

validator_for_radix validates each character by slicing a digit alphabet, making validation O(radix) per character. The alphabet ordering is also unusual (...ijlk...), which can cause incorrect acceptance or rejection for higher radices.

Desired outcome

Replace it with a correct constant-time validation approach (for example char::to_digit) and add coverage for high radices.

Location

ndc_lexer/src/number.rs, validator_for_radix.

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