What each validator in PiiCatalog.Validators was written from. Every source was accessed on 2026-11-04, unless its line gives another date. "Official" means the issuer, its government, or a standard or register the issuer names. Where a page could not be fetched directly, the line says which copy was read.
The checks in PiiCatalog.Validators were written before python-stdnum (LGPL-2.1-or-later) was read, and were checked against these sources on 2026-11-04. PiiCatalog.Validators.NationalIds and PiiCatalog.Validators.VatEu replace a first version written after reading python-stdnum: on 2026-11-04 they were rewritten from these sources without consulting another implementation. The rewrite kept the first version's regexes in PiiCatalog.Patterns, which set each number's shape, and its test values (see "Test values"). The isikukood's check digit was added on 2026-11-11 from the sources on its line, after its author had read another implementation of it. Each line below says what the check does and what it was written from or checked against.
PiiCatalog.Validators
luhn— Official spec: ISO/IEC 7812-1:2017 Annex B, "Luhn formula for computing modulus-10 'double-add-double' check digits" (ISO/IEC JTC 1/SC 17), https://www.iso.org/standard/70484.html. The full text is sold, so only the free preview was read. The same method is described in full by Skatteverket's SKV 704 (seepersonnummer_se) and INSEE (see VATFR). The check is that method, doubling every second digit from the right. The card prefixes are in the regex, not the validator. They differ from the networks' published ranges: Mastercard's 2-series (222100–272099) is not matched, and Discover's IIN Range Summary (discoverglobalnetwork.com/downloads/IPP_VAR_Compliance.pdf) lists ranges that include 6440–6589, where the regex has 6011 and 65. Both are listed in the README's false negatives.ip_octets— Official spec: RFC 3986 §3.2.2,IPv4address/dec-octet(IETF), https://www.rfc-editor.org/rfc/rfc3986.html. Each of the four parts is a number from 0 to 255. One deliberate difference: zero-padded parts such as010.001.002.003are accepted, which RFC 3986's grammar does not allow (§7.4 notes that some platforms accept such forms). A unit test asserts it.nanp_phone— Issuing-authority documentation: NANPA, "About the NANP", https://www.nanpa.com/about ("NXX-NXX-XXXX where N is any digit from 2 through 9"). The area code and the exchange each start with 2 to 9.ssn_structure— Official: SSA POMS RM 10201.035 "Invalid Social Security Numbers", https://secure.ssa.gov/POMS.NSF/lnx/0110201035, and IRS IRM 21.8.1.1.21 (procedural update WI-21-0116-0135), https://www.irs.gov/pub/foia/ig/spder/WI-21-0116-0135_Redacted.pdf. Area 000 and 666, group 00 and serial 0000 are refused. An area from 900 to 999 is accepted only with an ITIN group (50–65, 70–88, 90–92, 94–99), because the SSA lists the 900 series as never assigned and the IRS defines the ITIN groups.iban— Official: SWIFT IBAN Registry, Release 98, read from the copy the Central Bank of Yemen hosts, https://cby-ye.com/files/67335413e8237.pdf (swift.com refused the request), for the lengths and ISO 7064 MOD 97-10. Also EPC409-09 "EPC List of Countries in the SEPA Schemes' Geographical Scope" v8.0 (24 December 2025), https://www.europeanpaymentscouncil.eu/sites/default/files/kb/file/2025-12/EPC409-09%20EPC%20List%20of%20SEPA%20Scheme%20Countries%20v8.0.pdf. The check is the length the registry gives for the country and the mod-97 check digits, for the countries in the EPC list only. FO (Faroe Islands) and GL (Greenland) are refused: they are not in the EPC list, and the README and code say SEPA.personnummer_se— Official: Skatteverket SKV 704 ed. 8, "Personnummer", read from the Sweden Connect mirror, https://docs.swedenconnect.se/technical-framework/mirror/skv/skv704-8.pdf. Also https://www.skatteverket.se/privat/folkbokforing/personnummer and https://skatteverket.se/privat/folkbokforing/samordningsnummer. The check is the date, the separator, the 60 added to the day for a samordningsnummer, the Luhn check digit, and a birth number from 001 to 999, as SKV 704 gives it; 000 is refused.fodselsnummer_no— Official: Skatteetaten, "Nytt fødselsnummer fra 2032", https://skatteetaten.github.io/folkeregisteret-api-dokumentasjon/nytt-fodselsnummer-fra-2032/ (the current k1 and k2 weights, and a result of 10 is discarded). Also Skatteetaten's Folkeregisterhåndboken for the D-nummer (4 added to the first digit). The check is the date, with 40 taken off the day only when its first digit is 4 to 7 (a D-nummer), and the two check digits. The H-nummer (month plus 40) is refused. Direktoratet for e-helse, HITR 1001:2010 (updated 10/2020) §3.1, read from the Wayback Machine copy of 23 November 2021, https://web.archive.org/web/20211123084819id_/https://www.ehelse.no/standardisering/standarder/identifikatorer-for-personer/_/attachment/inline/79ac0f51-8e2b-488e-a2b8-3b65521887d8:95e4c33fc8e356d02649c6f50bca080247e4cbd5/Identifikatorer%20for%20personer%20oppdatert%20HITR1001_2010.pdf (the live copy returned HTTP 500), describes it as a help number that each patient-record system creates for use inside one organisation, by a recommended algorithm (4 added to the third digit). It is not issued by the national register and its check digits are not guaranteed, so it is not treated as a fødselsnummer. The new k1 rule for numbers issued from 1 January 2032 is not implemented.hetu_fi— Official: Valtioneuvoston asetus 690/2022 amending 128/2010 § 2 (century signs, check character table), https://www.finlex.fi/api/media/statute/17253/mainPdf/main.pdf, and Statistics Finland, https://stat.fi/meta/kas/hetu.html ("juokseva numero väliltä 002-899"). DVV's page, https://dvv.fi/henkilotunnus (read from the Wayback Machine copy of 12 October 2026; the live page returned 403), gives the same range. The check is the date, the century sign, an individual number from 002 to 899 and the check character. Numbers from 900 are refused: Kela, on Kanta's "Test etiquette" page, https://www.kanta.fi/en/system-developers/test-etiquette (Wayback Machine copy of 19 February 2025), says the 900-series codes it issues are for testing and are not official personal identity codes.cpr_dk— Issuing-authority documentation: CPR-kontoret, "Personnumre uden kontrolciffer (modulus 11 kontrol)", https://www.cpr.dk/cpr-systemet/personnumre-uden-kontrolciffer-modulus-11-kontrol, and "Personnummeret i CPR-systemet" (2008), https://cdn9.cpr.dk/cpr/media/12066/personnummeret-i-cpr.pdf. The check is the date only: since 2007 a number is not guaranteed to pass the modulus-11 check.kennitala_is— Issuing-authority documentation: Þjóðskrá, "Um kennitölur", https://www.skra.is/folk/eg-i-thjodskra/um-kennitolur/, and "Kennitölur án vartölu", https://www.skra.is/folk/eg-i-thjodskra/um-kennitolur/kennitolur-an-vartolu/. The check digit is not checked, since Þjóðskrá issues kennitölur that do not pass the check-digit test from 18 February 2026. Only DDMMYY and the century digit (8, 9 or 0) are checked. Þjóðskrá's own test numbers (e.g. 281191-3049) have that shape. The pattern requires the word kennitala, kennitölu or kt. directly before the number (see the README). The +40 day for companies is not checked, because no official source for it could be read; a day over 31 is refused.steuer_id_de— Official: Steueridentifikationsnummerverordnung § 1 (gesetze-im-internet.de); Bayerisches Landesamt für Steuern / ELSTER, "Prüfung der Steuer- und Steueridentifikationsnummer", https://download.elster.de/download/schnittstellen/Pruefung_der_Steuer_und_Steueridentifikatsnummer.pdf; and BZSt, "Erzeugung von Identifikationsnummern" (released under FOI), https://media.frag-den-staat.de/files/foi/607002/erzeugung-von-identifikationsnummern-grundlegende-beschreibung-der-struktur-und-merkmale.pdf. The check is no leading 0, the digit pattern, and the check-digit procedure. The procedure isiso7064_mod11_10/1, though neither document names ISO 7064.bsn_nl— Official: RvIG, "Logisch Ontwerp BSN" version 2025.Q4, https://rvig.nl/sites/default/files/2025-11/Logisch%20Ontwerp%20BSN%202025.Q4.pdf. The check is the 11-proef. The specification also allows eight digits with a leading zero added; the regex only takes nine, so that form is not matched.nir_fr— Official: INSEE, "Identifiant d'individus : NIR", https://xml.insee.fr/schema/nir.html (the key and Corsica); GIP-MDS, DSN cahier technique CT2021.1.1, https://www.net-entreprises.fr/media/documentation/dsn-cahier-technique-2021.1.1.pdf (sex 1 or 2, months, department, commune and order number 001–999); and Cnav, "Veillez à la bonne identification de vos salariés" (2017), https://www.net-entreprises.fr/media/2018/11/n4ds-identification-salaries.pdf. The check is the key, the month and the order number, and a sex digit of 1 or 2: 3, 4, 7 and 8 are refused (DSN and Cnav: 1 or 2; 7 and 8 are provisional numbers not to be used; no source for 3 or 4), and the regex starts with[12]. Department 00 and commune 000 are refused. The months follow the DSN (01–12, 20, 30–42, 50–99); the Cnav flyer gives 20–99, a conflict left unresolved. The DSN's year-dependent department rules are not applied, since the century is not in the number.dni_es— Official: Ministerio del Interior, "Cálculo del dígito de control del NIF/NIE", https://www.interior.gob.es/opencms/es/servicios-al-ciudadano/tramites-y-gestiones/dni/calculo-del-digito-de-control-del-nif-nie/ (read from the Wayback Machine capture of 30 December 2025; the live page returned 403). The check is the number mod 23 indexed into TRWAGMYFPDXBNJZSQVHLCKE.nie_es— Official: the same Ministerio del Interior page (X, Y, Z read as 0, 1, 2), and Orden INT/2058/2008 (BOE 15 July 2008). The check is the DNI letter over the number with X, Y or Z read as a digit. NIEs issued before 2008 as X and eight digits are not matched by the regex.codice_fiscale_it— Official: Decreto Ministeriale 23 dicembre 1976, "Sistemi di codificazione dei soggetti da iscrivere all'anagrafe tributaria", Supplemento ordinario alla Gazzetta Ufficiale n. 345 del 29 dicembre 1976, arts. 1–7, https://www.gazzettaufficiale.it/eli/gu/1976/12/29/345/so/0/sg/pdf (scanned; the omocodia table read from the page image), and Agenzia delle Entrate, hearing of 10 February 2016 on omocodia. The check is the month letters, the day plus 40, the odd and even tables, mod 26, and the omocodia letters L M N P Q R S T U V, on a code written in capitals.nino_gb— Official: HMRC National Insurance Manual NIM39110, "What a NINO looks like", https://www.gov.uk/hmrc-internal-manuals/national-insurance-manual/nim39110. The check is the excluded letters, O not second, the excluded prefixes, and suffix A–D.
PiiCatalog.Validators.NationalIds
pesel_pl— Official spec: Ustawa z dnia 24 września 2010 r. o ewidencji ludności, art. 15 (Dz. U. 2026 poz. 384), https://api.sejm.gov.pl/eli/acts/DU/2026/384/text/U/D20260384Lj.pdf, and Rozporządzenie MSW z dnia 4 stycznia 2012 r. w sprawie nadania lub zmiany numeru PESEL, § 7, https://eli.gov.pl/eli/DU/2012/74/ogl/pol/pdf (weights 1-3-7-9-1-3-7-9-1-3). Two own restrictions beyond the act: the 1800s (+80) are refused because no holder is alive, and so is a date after today.rrn_be— Official spec: Registre national, "T.I. 000 – Le numéro d'identification" (2016), https://www.rijksregister.fgov.be/sites/default/files/documents/fr/registre-national/instructions/liste-TI/TI000_Numero-identification.pdf, and Banque Carrefour de la sécurité sociale, "Registres: concepts et règles", https://www.banquecarrefour.fgov.be/sites/default/files/assets/services_et_support/documentation/tss_registries_concepts_fr.docx. The checks are the month and day 00 when unknown, serial 001–998, and 97 − (number mod 97) with a 2 in front for births from 2000. The 2000 reading is tried only for a year that has begun (own restriction). Bis numbers (month +20 or +40) are not national register numbers and are not accepted. TI000's example "40 00 00 955-81" does not compute under its own rule and is not used as a test.ppsn_ie— Official, plus own derivation. Department of Social Protection, "Extension of the Personal Public Service Number Range" (Wayback Machine copies: http://www.welfare.ie/en/Pages/Extension-of-the-Personal-Public-Service-Number-Range.aspx, http://www.welfare.ie/EN/Topics/PPSN/Pages/ppsnrangeextension.aspx) gives the structure, mod 23 and the ninth character (A = 1, B = 2 and so on, W or blank 0, weight 9). Revenue's Tax and Duty Manual, Stamp Duty ch. 3, https://www.revenue.ie/en/tax-professionals/tdm/stamp-duty/file-and-pay/chapter-03-tax-reference-numbers/tax-reference-numbers.pdf, says H in ninth place is a Local Property Tax number, not a PPS number, and the check refuses it. The regex takes only A, B, H, W, T or X as the ninth character, so a number with any other ninth letter is not matched. The department does not publish the weights for positions 1–7 or the letter for each remainder. Those are taken from the Irish VAT number rules in the BMF Konstruktionsregeln (see VATIE: weights 8–2, 0 = W, 1–22 = A–V). They reproduce both of the department's examples: 1234567 gives T, and 1234567 with A gives F.nif_pt— Official: Decreto-Lei n.º 14/2013, art. 4 (nine digits, the last a check digit), https://info.portaldasfinancas.gov.pt/pt/informacao_fiscal/legislacao/diplomas_legislativos/Documents/Decreto-Lei_14-2013.pdf. The check digit comes from the Portuguese VAT rules in the BMF Konstruktionsregeln (see VATPT), whose number is the NIF. Portugal publishes no NIF check algorithm of its own that could be found.ahv_ch— Official spec: ZAS, "AHV-Nummer", https://www.zas.admin.ch/de/ahv-nummer-identifikator, and BSV, "Wegleitung über Versicherungsausweis und individuelles Konto (WL VA/IK)" Anhang 7, https://sozialversicherungen.admin.ch/de/d/6938/download. The checks are the 756 prefix and the EAN-13 check digit (weights 3 and 1 from the right).svnr_at— Official spec: Anfragebeantwortung 4690/AB XXIII. GP (Federal Minister of Health, 2008), https://www.parlament.gv.at/dokument/XXIII/AB/4690/fnameorig_136871.html, and Dachverband, "Organisationsbeschreibung Datenaustausch mit Öffentlichen Apotheken (DOA)", https://www.sozialversicherung.at/cdscontent/load?contentid=10008.800069&version=1765288095. The checks are serial 100–999, check digit = (weights 3 7 9 / 5 8 4 2 1 6) mod 11 (10 is never issued), and day 01–31. The month is any from 01, since a month from 13 stands for an unknown date (the DOA writes "13, 14, 15, …").isikukood_ee— Official for the structure, secondary for the check digit. Siseministri määrus "Isikukoodide moodustamise ja andmise kord", § 4 (RT I, 19.11.2025, 3), https://www.riigiteataja.ee/akt/119112025003 (century and sex digit, YYMMDD, serial, check digit). The check digit's rule is in the standard EVS 585, which is sold, not published; no official free text of it was found. The rule checked is the one in the Estonian Wikipedia article "Isikukood", section "Kontrollnumber", https://et.wikipedia.org/wiki/Isikukood#Kontrollnumber (accessed 2026-11-11): the first ten digits weighted 1 2 3 4 5 6 7 8 9 1, mod 11; a remainder of 10 is retried with 3 4 5 6 7 8 9 1 2 3, and a second 10 gives 0. The Information System Authority (RIA) cites that article on the formula's origin and its weakness in "Eesti e-identiteedi ökosüsteem", version 1.4, § 2.2.4, https://www.ria.ee/sites/default/files/documents/2025-10/eID-okosusteem-lisadega-2025.pdf (accessed 2026-11-11). Own restrictions: the 1800s and a date after today are refused. The pattern requires the word isikukood directly before the number.nhs_gb— Official spec: NHS Data Dictionary, "NHS NUMBER", https://www.datadictionary.nhs.uk/attributes/nhs_number.html (weights 10–2, 11 − remainder, 11 → 0, 10 invalid).
PiiCatalog.Validators.VatEu
"BMF" is the Austrian Federal Ministry of Finance, "Information über die Konstruktionsregeln der Umsatzsteuer-Identifikationsnummern (UID)", Stand November 2020, https://www.bmf.gv.at/dam/jcr:d6794f8f-d321-43df-9840-1a841f9bf5dc/BMF_UID_Konstruktionsregeln_Stand_November%202020.pdf. It holds the rules "vom jeweiligen Mitgliedstaat aufgrund bilateraler Vereinbarungen zur Veröffentlichung freigegeben", each with a worked sample, which the tests use. For ten states it says publication was not agreed. The European Commission's VIES FAQ, https://ec.europa.eu/taxation_customs/vies/#/faq, gives every state's format and says the Commission "cannot divulge these algorithms".
AT— Official spec: BMF, "AT – Österreichische UID". U and eight digits; C9 from S(C3), S(C5), S(C7) and C2 + C4 + C6 + C8 + 4. The precedence of Si is settled by the SE sample in the same document.BE— Official spec: BMF, "BE – Belgische UID" (first digit 0 or 1 from 2020; 97 − first eight mod 97), and FPS Economy, "Les numéros d'entreprise passent au 1" (2023), https://news.economie.fgov.be/228779-les-numeros-d-entreprise-passent-au-1/.BG— Structure only (nine or ten digits). The BMF says publication was not agreed. The BULSTAT Act art. 6 (https://www.bulstat.bg/uploaded/files/4-zakonzaregistrbulstat.pdf) gives the EIK's length only. A ten-digit number may be an EGN, whose check is published (Наредба № РД-02-20-9, art. 104), or a foreigner's number, whose check is not (the Ministry of Finance and BNB instruction, https://www.bnb.bg/bnbweb/groups/public/documents/bnb_law/instructions_bnb_51681_bg.pdf, which says to check its length only). The two cannot be told apart, so no check is applied.CY— Structure only (eight digits and a letter). The BMF says publication was not agreed. Cyprus's TIN sheet to the OECD (https://www.oecd.org/content/dam/oecd/en/topics/policy-issue-focus/aeoi/cyprus-tin.pdf) says the letter comes "from an algorithm" without giving it.CZ— Official: zákon č. 280/2009 Sb. (daňový řád) § 130 (the number is the IČO of a legal entity or a person's birth number); zákon č. 133/2000 Sb. § 13 (birth numbers); both read from zakonyprolidi.cz, https://www.zakonyprolidi.cz/cs/2009-280 and https://www.zakonyprolidi.cz/cs/2000-133. Also Český statistický úřad, "Připojení AIS editorů ROS k systému základních registrů" §2.1.5 (IČO, weights 8–2, a difference of 11 gives 1 and of 10 gives 0), https://www.szrcr.cz/images/dokumenty/ROS/Pr%CC%8Cipojeni%CC%81_Ais_editoru%CC%8A_ROS_k_syste%CC%81mu_za%CC%81kladni%CC%81ch_registru%CC%8A.pdf. Eight digits get the IČO check. Ten digits get the date (month +50, and +20 or +70 since 2004) and divisibility by 11. Nine digits get the date only: § 13(4) says birth numbers of people born before 1954 have nine digits and are not divisible by 11. The BMF says publication of the VAT rules was not agreed, and the tax administration's own identifier (VČP) has no published format.DE— Official spec: BMF, "DE – Deutsche UID" (first digit not 0; iterative procedure = ISO 7064 MOD 11,10).DK— Official spec: BMF, "DK – Dänische UID" (weights 2 7 6 5 4 3 2 1, divisible by 11), and Danmarks Statistik, CVR-nummer documentation, https://www.dst.dk/da/Statistik/dokumentation/Times/moduldata-for-arbejdsmarked/cvr-nr.EE— Official spec: BMF, "EE – Estnische UID" (starts 10; weights 3 7 1; next multiple of ten).EL— Structure only (nine digits). The BMF says publication was not agreed. The EC TIN sheet and VIES give the length only.ES— Official: Real Decreto 1065/2007 arts. 19–22, https://www.boe.es/buscar/act.php?id=BOE-A-2007-15984; Orden EHA/451/2008 arts. 2–5, https://www.boe.es/buscar/act.php?id=BOE-A-2008-3580; and the Ministerio del Interior's DNI/NIE page (seedni_es). A person's NIF (DNI number and letter) and an NIE get their check letter. Legal entities (first letter A–H, J, N, P, Q, R, S, U, V, W, then seven digits and a control character) and the K, L and M forms are structure only: the Orden gives "un carácter de control" without its computation, and the BMF says publication was not agreed.FI— Official spec: BMF, "FI – Finnische UID", and Valtioneuvoston asetus 288/2001 § 3, https://www.finlex.fi/files/extra/statute-book-of-finland-pdf/fin/2001/20010042.pdf (weights 2 4 8 5 10 9 7 from the right; remainder 1 never issued).FR— Official, partly structure only. The SIREN is checked: INSEE, "Identifiants économiques : SIREN, NIC et SIRET" §8 (Luhn), https://xml.insee.fr/schema/siret.html. The two-character key is structure only: impots.gouv.fr (https://www.impots.gouv.fr/professionnel/les-numeros-didentification) and BOFiP BOI-CF-CPF-20-20-10 describe it but not its computation, and the BMF says publication was not agreed. The check takes any capital letter or digit in the key; the regex leaves out I and O, which the BMF allows ("Buchstabe oder Ziffer"), so a number with either in its key is not matched. Luhn is applied as in ISO/IEC 7812-1, doubling every second digit from the right.HR— Official spec: Zakon o osobnom identifikacijskom broju (NN 60/2008) art. 3, https://narodne-novine.nn.hr/clanci/sluzbeni/2008_05_60_2033.html; Pravilnik o osobnom identifikacijskom broju (NN 1/2009) art. 3 (ISO 7064 MOD 11,10), https://narodne-novine.nn.hr/clanci/sluzbeni/2009_01_1_6.html; and REGOS, "Kontrola OIB-a", https://regos.hr/app/uploads/2018/07/KONTROLA-OIB-a.pdf (worked example 69435151530). The BMF says publication of the VAT rules was not agreed.HU— Official spec: BMF, "HU – Ungarische UID" (weights 9 7 3 1; a last digit of 0 gives 0), and NAV, "Ajánlás számlázó programok fejlesztői számára" v1.0, https://nav.gov.hu/pfile/file?path=%2Fado%2Fafa%2FSzamlazo_Fejlesztoi_Ajanlas_v1.0.IE— Official spec: BMF, "IE – Irische UID", versions 1 to 3 (weights 8–2 mod 23, letters W, A–V, ninth letter A–I with weight 9), and Revenue, "VIES Traders Manual", https://www.revenue.ie/en/tax-professionals/tdm/value-added-tax/vat-information-exchange-system-VIES/vies-traders-manual.pdf.IT— Official spec: BMF, "IT – Italienische UID", and DM 23 dicembre 1976 arts. 8–9 (GU n. 345 suppl., seecodice_fiscale_it). The BMF's rule allows office codes 001–100, 120, 121, 888 and 999, but its own worked example tests 001–150. The check accepts 001–150, 888 and 999.LT— Official spec: BMF, "LT – Litauische UID" (C8 = 1 for nine digits, C11 = 1 for twelve; two rounds of weights mod 11), and VĮ Registrų centras, "Juridinių asmenų registro tvarkymo taisyklės", https://www.registrucentras.lt/bylos/dokumentai/jar/JARtvarkymotaisykles.pdf.LU— Official spec: BMF, "LU – Luxemburgische UID" (first six mod 89).LV— Structure only (eleven digits). The BMF says publication was not agreed. LV portāls (Latvijas Vēstnesis), https://lvportals.lv/skaidrojumi/248652-personas-kods-ir-tava-identitate-sarga-to-2012, says the personal code's algorithm is not public: access to it is restricted.MT— Structure only (eight digits). The BMF says publication was not agreed, and VIES gives the length only.NL— Official spec: BMF, "NL – Niederländische UID" (modulo 11, or modulo 97 over "NL" and the twelve characters since 2020, with the suffix rules).PL— Official spec: BMF, "PL – Polnische UID"; Ministry of Finance of Poland, TIN sheet, https://www.oecd.org/content/dam/oecd/en/topics/policy-issue-focus/aeoi/poland-tin.pdf; and the Ministry's XML typeTNrNIP, http://crd.gov.pl/xml/schematy/dziedzinowe/mf/2022/01/05/eD/DefinicjeTypy/ElementarneTypyDanych_v10-0E.xsd. The check is weights 6 5 7 2 3 4 5 6 7 mod 11, with 10 never issued, a first digit other than 0, and the second and third digits not both 0.PT— Official spec: BMF, "PT – Portugiesische UID" (first digit not 0; 11 − weighted sum mod 11, 10 and 11 giving 0), and Decreto-Lei 14/2013 art. 4 (seenif_pt).RO— Structure only (two to ten digits, no leading zero). The BMF gives that form ("mind. 2 Stellen - max. 10 Stellen", "Seit 5.12.2007 keine Führungsnullen!") and says publication of the rules was not agreed; VIES gives the length. The regex takes six to ten digits, so shorter numbers, which the BMF allows, are not matched.SE— Official spec: BMF, "SE – Schwedische UID" (Luhn check digit at C10; C11–C12 from 01 to 94), and Skatteverket, "Köpa tjänster från andra EU-länder", https://www.skatteverket.se/foretag/moms/kopavarorochtjanster/inkopfranandraeulander/kopatjansterfranandraeulander.4.361dc8c15312eff6fd1d011.html (an organisationsnummer, or a sole trader's personnummer). Also SKV 709 ed. 8, "Organisationsnummer", https://docs.swedenconnect.se/technical-framework/mirror/skv/skv709-8.pdf (the third digit is at least 2). The check requires a third digit from 2, or else a personnummer date.SI— Official spec: BMF, "SI – Slowenische UID" (first seven from 1000000; 11 − weighted sum mod 11, 10 giving 0, 11 never issued), and FURS, "Vpis v davčni register in davčna številka", https://www.fu.gov.si/davki_in_druge_dajatve/poslovanje_z_nami/vpis_v_davcni_register_in_davcna_stevilka/ ("kontrolirana po modulu 11").SK— Official spec: BMF, "SK – Slowakische UID" (first digit 1–9, third digit 2, 3, 4, 7, 8 or 9, divisible by 11).
Test values
Most values in the vector files for vat_eu, pesel_pl, rrn_be, ppsn_ie, nif_pt, ahv_ch, svnr_at, isikukood_ee and nhs_gb were generated on 2026-10-19 by running python-stdnum: numbers of the right shape that it accepted, and near misses that it refused. Each also passes or fails the validators written from the sources above, as its file expects, so most values have been checked by two separately written validators. Each file names the issuers' own examples among them. Values that also appear in python-stdnum's documentation or tests were replaced on 2026-11-05 and 2026-11-13, apart from published examples and simple sequences such as 123456789.