View Source UkraineTaxidEx.Itin.CheckSum (ukraine_tax_id v0.1.1)
Module for calculating the checksum of Ukrainian Individual Tax Identification Numbers (ITIN). Provides functions for checksum calculation based on weighted digits and helper functions for working with ITIN weights and dividers. Uses specified numerical weights to multiply each digit of the ITIN and validate its authenticity.
Summary
Functions
Calculate checksum for ITIN number. The checksum for ITIN is calculated in several steps
Returns the list of numerical weights used to calculate the ITIN checksum. Each digit in the ITIN is multiplied by its corresponding weight.
Functions
@spec check_sum( digits :: UkraineTaxidEx.Commons.digits(), weights :: UkraineTaxidEx.Commons.digits() ) :: integer()
Calculate checksum for ITIN number. The checksum for ITIN is calculated in several steps:
- Multiply each digit by its corresponding weight
- Sum the products
- Take mod 11 of the sum
- If mod 11 is greater or equal than 10, repeat steps 2-4 with weights +2
@spec weights() :: UkraineTaxidEx.Commons.digits()
Returns the list of numerical weights used to calculate the ITIN checksum. Each digit in the ITIN is multiplied by its corresponding weight.