RUC (Registro Único de Contribuyentes, Ecuadorian company tax number).
The RUC is a tax identification number for legal entities. It has 13 digits where the third digit is a number denoting the type of entity.
>>> validate('1792060346-001')
'1792060346001'
>>> validate('1763154690001') # invalid check digit
Traceback (most recent call last):
...
InvalidChecksum: ...
>>> validate('179206034601') # too short
Traceback (most recent call last):
...
InvalidLength: ...
Traceback (most recent call last):
...
InvalidLength: ...
Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.
Checks to see if the number provided is a valid RUC number. This checks the length, formatting, check digit and check sum.
Checks to see if the number provided is a valid RUC number. This checks the length, formatting and check digit.