checkdigit 0.1.0 checkdigit: ^0.1.0 copied to clipboard
A set of check digit algorithms used for error detection on identification numbers.
Checksum #
A set of check digit algorithms used for error detection on identification numbers.
Installation #
In pubspec.yaml
add the following dependency:
dependencies:
checkdigit: ^0.1.0
Algorithms #
Luhn #
bool isValid = luhn.validate('79927398713');
int checkDigit = luhn.checkDigit('7992739871');
Verhoeff #
bool isValid = verhoeff.validate('2363');
int checkDigit = verhoeff.checkDigit('236');
Damm #
bool isValid = damm.validate('5724');
int checkDigit = damm.checkDigit('572');
ISBN #
bool isValid = isbn10.validate('080442957X');
int checkDigit = isbn10.checkDigit('080442957');
bool isValid = isbn13.validate('9783161484100');
int checkDigit = isbn13.checkDigit('978316148410');
ISIN #
bool isValid = isin.validate('US0378331005');
int checkDigit = isin.checkDigit('US037833100');
CPF #
bool isValid = cpf.validate('11144477735');
int checkDigit = cpf.checkDigit('111444777');
IBAN #
bool isValid = iban.validate('GB82WEST12345698765432');
int checkDigit = iban.checkDigit('GB00WEST12345698765432');