ANUM (Közösségi adószám, Hungarian VAT number).

The ANUM is the Hungarian VAT (Közösségi adószám) number. It is an 8-digit taxpayer registration number that includes a weighted checksum.

>>> validate('HU-12892312')
>>> validate('HU-12892313')  # invalid check digit
Traceback (most recent call last):
InvalidChecksum: ...

Calculate the checksum. Valid numbers should have a checksum of 0.

Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.

Check if the number provided is a valid VAT number.

Check if the number is a valid VAT number. This checks the length, formatting and check digit.