public class CreditCard extends Object implements ITransformation
Constructor and Description |
---|
CreditCard() |
Modifier and Type | Method and Description |
---|---|
static int[] |
getDigits(String chars)
Transform a string of digits to array of integers.
|
static void |
main(String[] args)
Test of LUHN algorithm.
|
static String |
mod10CheckDigit(String value)
MOD 10 - Luhn algorithm for Credit Card encoding.
|
static String |
toCreditCard(String input)
Fix the last digit of a credit card number.
|
String |
transform(String input)
Method to transform a value.
|
public static final String LABEL
public String transform(String input)
ITransformation
transform
in interface ITransformation
input
- Input Stringpublic static String toCreditCard(String input)
input
- number string to be changedpublic static String mod10CheckDigit(String value)
value
- string of digitspublic static int[] getDigits(String chars)
chars
- string of digitspublic static void main(String[] args)
args
- emptyCopyright © 2021. All rights reserved.