DEV Community

Manuel Felipe Arias Pineda
Manuel Felipe Arias Pineda

Posted on

🇵🇱 Polska devs: Add Dowód Osobisty / PESEL to the AI identity standard — Soulprint open source (30 min PR)

Agenci AI podejmują decyzje bez weryfikacji tożsamości. Soulprint — ZK Proofs, lokalnie, MIT.

🇵🇱 Dowód osobisty i PESEL nie są jeszcze w Soulprint. Dodaj je w 30 minut.

PESEL / Dowód

PESEL: 11 cyfr — data urodzenia + numer serii + płeć + cyfra kontrolna (mod-10 ważony).
Dowód: 3 litery + 6 cyfr.

const PL: CountryVerifier = {
  countryCode: "PL", countryName: "Poland",
  documentTypes: ["dowod_osobisty", "pesel"],
  parse(ocrText: string): DocumentResult {
    const pesel = ocrText.match(/(\d{11})/)?.[1] ?? "";
    return { valid: !!pesel, doc_number: pesel, country: "PL" };
  },
  validate(docNumber: string): NumberValidation {
    if(!/^\d{11}$/.test(docNumber)) return {valid:false};
    const w=[1,3,7,9,1,3,7,9,1,3];
    const sum=w.reduce((s,v,i)=>s+(v*Number(docNumber[i]))%10,0);
    return { valid: (10-(sum%10))%10 === Number(docNumber[10]) };
  },
};
export default PL;
Enter fullscreen mode Exit fullscreen mode

💻 GitHub · Jeden PR. Jeden kraj.

Top comments (0)