-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Create a new package cpf-cd to calculate check digits (dígitos verificadores) for CPF. Although the logic of calculating these numbers are already implemented inside cpf-gen, these should be removed from that in the next major version in favor of this package.
- Create a class
CpfCheckDigitsto lazyly calculate first and second checkdigits. The base CPF for the calculation should be passed to the constructor and validated accordingly:- CPF provided should have between 9 and 11 digits after sanitization. Throw exception if not met.
- Repeated sequences of digits (e.g.
111.111.111-*,222.222.222-*,333.333.333-*nad so on) are considered invalid CPF's, so the input of these value should throw an exception. - CPF should be provided as string, list of strings or list of integers.
- All errors thrown by the package should be custom, prefixed with
CpfCheckDigits*TypeErrorfor type errors andCpfCheckDigits*Exceptionfor other exceptions.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Projects
Status
In progress