~mendelmaleh/checksum

3c2ecf21725bdf557755e38986f7d9fce7e4b4f2 — Mendel E 10 months ago e71e2f6 master
Luhn optimizations

:shrug:
1 files changed, 2 insertions(+), 2 deletions(-)

M luhn.go
M luhn.go => luhn.go +2 -2
@@ 18,12 18,12 @@ func getluhn(i, n, c int) int {

// Luhn checksum validation
func Luhn(num int) bool {
	return IterInt(num, luhn)%10 == 0
	return IterInt(num*100, luhn)%10 == 0
}

// GetLuhn calculates the Luhn check digit for num.
func GetLuhn(num int) int {
	return IterInt(num, getluhn) * 9 % 10
	return IterInt(num*100, getluhn) * 9 % 10
}

// LuhnString checksum validation