|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.thehackerschoice.shagg.algorithms.Modulus10Algorithm | +--com.thehackerschoice.shagg.algorithms.Modulus10AlgorithmLuhn | +--com.thehackerschoice.shagg.algorithms.Modulus10AlgorithmCC
The algorithm used in Credit Cards is claimed to be the Luhn Algorithm. In fact it is a variant that uses an extra check digit that is always 0.
Fields inherited from class com.thehackerschoice.shagg.algorithms.Modulus10Algorithm |
type |
Constructor Summary | |
Modulus10AlgorithmCC()
Init the Modulus 10 CC Algorithm. |
Method Summary | |
boolean |
check(int[] sequence,
int[] weights)
Checks if the supplied sequence matches the Modulus 10 Algorithm. |
int |
getCheckDigitPosition(int sequence)
Return the check digit position inside the sequence. |
int |
mod10checkDigit(int[] sequence)
The result of the modulus operation is compared to 0 in all cases. |
Methods inherited from class com.thehackerschoice.shagg.algorithms.Modulus10AlgorithmLuhn |
mod10Add |
Methods inherited from class com.thehackerschoice.shagg.algorithms.Modulus10Algorithm |
getName,
getSymbol,
usesWeights |
Methods inherited from class java.lang.Object |
|
Constructor Detail |
public Modulus10AlgorithmCC()
Method Detail |
public boolean check(int[] sequence, int[] weights)
sequence
- Integer sequence representing the digits to check,
not necessary between 0 and 9.weights
- Integer sequence of the weights to use, may be of
any length.public int mod10checkDigit(int[] sequence)
sequence
- Integer sequence representing the digits to check,
not necessary between 0 and 9.public int getCheckDigitPosition(int sequence)
sequence
- Length of the integer sequence representing the digits to check,
not necessary between 0 and 9.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |