Assign check digit to 0 if remainder is 10 #2492
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Title:
feat(isISO6346): improve ISO6346 container ID validation with checksum adjustments
Description:
This PR enhances the isISO6346 validator to comply more accurately with the ISO 6346 standard, specifically addressing checksum validation for container IDs where the checksum result is 10. According to the standard, if the checksum is 10, the check digit should be represented as 0. This update improves accuracy in validating container IDs, particularly for freight containers (category 'U') where the checksum is mandatory.
Changes include:
References:
"If the final difference is 10, then the check digit becomes 0. To ensure that this does not happen the standard recommends that serial numbers should not be used which produce a final difference of 10; however, there are containers in the market which do not follow this recommendation, so handling this case has to be included if a check digit calculator is programmed."
I think this should be considered as I'm currently working for a logistics company and we get container numbers that end with 0 (checksum is 10) very often. Hence, decided to help contribute. Let me know what you think!
Checklist