Skip to content

Commit

Permalink
Replace calculation with modulo
Browse files Browse the repository at this point in the history
  • Loading branch information
meyermarcel committed Jul 23, 2024
1 parent 02a8797 commit 45ceb38
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cont/check_digit.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func CalcCheckDigit(ownerCode string, equipCatID rune, serialNum int) int {
d *= 2
divider /= 10
}
return n - (n/11)*11
return n % 11
}

// charValue returns the index of character plus 10.
Expand Down

0 comments on commit 45ceb38

Please # to comment.