Skip to main content

gaze_recognizers/validators/
mod11.rs

1use gaze_types::ValidatorKind;
2
3/// Validates a German Steuer-ID with ISO 7064 MOD 11,10.
4pub fn validate_de_steuer_id(digits: &str) -> bool {
5    ValidatorKind::DeSteuerIdMod1110.validates(digits)
6}
7
8/// Validates a Dutch BSN with the 11-test.
9pub fn validate_bsn(digits: &str) -> bool {
10    ValidatorKind::BsnMod11.validates(digits)
11}
12
13/// Validates a Brazilian CPF with its two MOD-11 check digits.
14pub fn validate_cpf(digits: &str) -> bool {
15    ValidatorKind::CpfMod11.validates(digits)
16}
17
18/// Validates a Brazilian CNPJ with its two MOD-11 check digits.
19pub fn validate_cnpj(digits: &str) -> bool {
20    ValidatorKind::CnpjMod11.validates(digits)
21}
22
23/// Validates a UK NHS number with the MOD-11 checksum.
24pub fn validate_uk_nhs(digits: &str) -> bool {
25    ValidatorKind::UkNhsMod11.validates(digits)
26}