Skip to content

Fix: panic when building modulo_10 checksum for longer barcodes#44

Open
ronnybremer wants to merge 2 commits intobuntine:masterfrom
ronnybremer:master
Open

Fix: panic when building modulo_10 checksum for longer barcodes#44
ronnybremer wants to merge 2 commits intobuntine:masterfrom
ronnybremer:master

Conversation

@ronnybremer
Copy link
Copy Markdown

During the calculation of the modulo 10 checksum all even and odd values of the passed in barcode are added, eventually leading to an overflow when building the final checksum. By casting them to u16 this overflow condition is avoided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant