0 purchases
checkdigit
Checkdigit #
A set of check digit algorithms used for error detection on identification numbers.
Installation #
In pubspec.yaml add the following dependency:
dependencies:
checkdigit: ^0.3.1
copied to clipboard
Algorithms #
Luhn #
bool isValid = luhn.validate('79927398713');
int checkDigit = luhn.checkDigit('7992739871');
String checkDigitAsString = luhn.checkDigitAsString('7992739871');
copied to clipboard
Verhoeff #
bool isValid = verhoeff.validate('2363');
int checkDigit = verhoeff.checkDigit('236');
String checkDigitAsString = verhoeff.checkDigitAsString('236');
copied to clipboard
Damm #
bool isValid = damm.validate('5724');
int checkDigit = damm.checkDigit('572');
String checkDigitAsString = damm.checkDigitAsString('572');
copied to clipboard
ISBN #
// ISBN-10.
bool isValid = isbn10.validate('080442957X');
int checkDigit = isbn10.checkDigit('080442957');
String checkDigitAsString = isbn10.checkDigitAsString('080442957');
// ISBN-13.
bool isValid = isbn13.validate('9783161484100');
int checkDigit = isbn13.checkDigit('978316148410');
String checkDigitAsString = isbn13.checkDigitAsString('978316148410');
copied to clipboard
ISIN #
bool isValid = isin.validate('US0378331005');
int checkDigit = isin.checkDigit('US037833100');
String checkDigitAsString = isin.checkDigitAsString('US037833100');
copied to clipboard
CPF #
bool isValid = cpf.validate('11144477735');
int checkDigit = cpf.checkDigit('111444777');
String checkDigitAsString = cpf.checkDigitAsString('111444777');
copied to clipboard
IBAN #
bool isValid = iban.validate('GB82WEST12345698765432');
int checkDigit = iban.checkDigit('GB00WEST12345698765432');
String checkDigitAsString = iban.checkDigitAsString('GB00WEST12345698765432');
copied to clipboard
CNPJ #
bool isValid = cnpj.validate('11222333000181');
int checkDigit = cnpj.checkDigit('112223330001');
String checkDigitAsString = cnpj.checkDigitAsString('112223330001');
copied to clipboard
EAN-X #
// EAN-13.
bool isValid = ean13.validate('4006381333931');
int checkDigit = ean13.checkDigit('400638133393');
String checkDigitAsString = ean13.checkDigitAsString('400638133393');
// UPC-A.
bool isValid = upcA.validate('036000291452');
int checkDigit = upcA.checkDigit('03600029145');
String checkDigitAsString = upcA.checkDigitAsString('03600029145');
// EAN-8.
bool isValid = ean8.validate('73513537');
int checkDigit = ean8.checkDigit('7351353');
String checkDigitAsString = ean8.checkDigitAsString('7351353');
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.