RNC (Registro Nacional del Contribuyente, Dominican Republic tax number).
The RNC is the Dominican Republic taxpayer registration number for institutions. The number consists of 9 digits.
>>> validate('1-01-85004-3')
'101850043'
>>> validate('1018A0043')
Traceback (most recent call last):
...
InvalidFormat: ...
>>> validate('101850042')
Traceback (most recent call last):
...
InvalidChecksum: ...
>>> format('131246796')
'1-31-24679-6'
Traceback (most recent call last):
...
InvalidChecksum: ...
Calculate the check digit.
Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.
Reformat the passed number to the standard format.
Checks to see if the number provided is a valid RNC.
Checks to see if the number provided is a valid RNC.