public final class ModUtil extends Object
Modifier and Type | Method and Description |
---|---|
static int |
calculateLuhnMod10Check(List<Integer> digits)
Calculate Luhn Modulo 10 checksum (Luhn algorithm implementation)
|
static int |
calculateMod10Check(List<Integer> digits,
int multiplier,
int weight)
Calculate Generic Modulo 10 checksum
|
static int |
calculateMod11Check(List<Integer> digits)
Calculate Modulo 11 checksum assuming that the threshold is Integer.MAX_VALUE
|
static int |
calculateMod11Check(List<Integer> digits,
int threshold)
Calculate Modulo 11 checksum
|
public static int calculateLuhnMod10Check(List<Integer> digits)
digits
- The digits over which to calculate the checksumpublic static int calculateMod10Check(List<Integer> digits, int multiplier, int weight)
digits
- The digits over which to calculate the checksummultiplier
- Multiplier used for the odd digits in the algorithmweight
- Multiplier used for the even digits in the algorithmpublic static int calculateMod11Check(List<Integer> digits, int threshold)
digits
- the digits for which to calculate the checksumthreshold
- the threshold for the Mod11 algorithm multiplier growthCopyright © 2007-2014 Red Hat, Inc. All Rights Reserved