Skip to content

Validation logic is inconsistent across languages #751

@willbeason

Description

@willbeason

There are two instances I found where validation logic for codes is inconsistent across languages:

  1. Automatically expanding requested short code length if odd. Most of the
    language implementations automatically add 1 to the length of requested codes
    if the length indicates it is in the pair part of the code. Java, C++, Python,
    and Javascript are the outliers.

  2. Validate latitude and longitude bounds within validation logic for full
    codes. Most of the language implementations only check the first two characters
    for latitude/longitude bounds when within the validation logic for full codes,
    not when generally checking if codes are valid. This does introduce a strange
    case where a code is "valid", but is neither a valid short nor a valid long
    code. C++ is the outlier here.

I have a PR out to fix this:

#750

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions