Skip to content

check digit calculation #3

@rtphokie

Description

@rtphokie

Perhaps it's my unfamiliarity with Go, but I'm seeing two small errors in how the check digit is calculated.

Comparing the code in ups.go to the algorithm described here, it appears that line 55 should subtract 48 instead of 3 from the ascii value of the character.

Line 63 should also be enclosed in an else. As it stands the running sum of calculations for characters in the odd position also includes characters in the even position as well.

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