From 45ceb387ea9d50f1d26355a9070112b005d47e74 Mon Sep 17 00:00:00 2001 From: Marcel Meyer Date: Tue, 23 Jul 2024 16:10:30 +0200 Subject: [PATCH] Replace calculation with modulo --- cont/check_digit.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cont/check_digit.go b/cont/check_digit.go index b1d5451..1f64cec 100644 --- a/cont/check_digit.go +++ b/cont/check_digit.go @@ -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.