I am doing a program that needs to validate a series of documents - CPF, CNPJ and, if possible, RG.
My questions are as follows:
Are there valid CNPJs with a number of characters less than 14?
(eg, old companies).
Common format: xx.xxx.xxx/xxxx-xx
If yes, what minimum number of characters for a CNPJ to be valid?
Are there valid CPFs with a number of characters smaller than 11?
(eg older people)
Common format: xxx.xxx.xxx-xx
If yes,
what minimum number of characters for a CPF to be valid?
There are valid RGs with fewer (1) character numbers or
greater (2) than 9 (eg older persons (1) or children (2))
Format
common: xx.xxx.xxx-x
If yes, which minimum number and which number
maximum number of characters for an RG to be valid?