purduehackers / passport-issuing-office

🛂 Design your passport & register for passport assembly ceremonies.
https://passports.purduehackers.com
4 stars 3 forks source link

Change Machine Readable Passport lines to closer match ICAO 9303 specifications #44

Closed TheShadowEevee closed 3 weeks ago

TheShadowEevee commented 3 weeks ago

This PR includes a couple fixes to the Machine Readable Code (MRP), the two lines of data on the bottom of the passport data page.

  1. The first line is now truncated to 44 characters, effectively limiting long names to the workable space
  2. The expiration date in the MRP now has +1000 added to the year, matching the expiration date printed
  3. The second field (Passport type, was "H<") was changed to "H" to match the MRP Spec
  4. Names are now processed to correctly match them to MRP specification (See sources below)
  5. Checksums are now correctly calculated using the 7/3/1 weight system
  6. The checksum for the "Personal number" section has been changed from 0 to <, as it has no data
  7. Default.png / Default Passport has been updated to match the MRP as is generated here

Sources for this PR and MRP Specification: Primary: Wikipedia - Machine Readable Passport Secondary: ICAO 9303 Standard PDFs - Parts 1, 3, 4

Continuing Deviations / Ignored Issues:

  1. DOB and Expiration Date use YYYYMMDD format versus YYMMDD format. This is left as is to leave the full expiration date year intact.
  2. The unused "Personal number" section is shortened to account for deviation 1.
vercel[bot] commented 3 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
passport-data-pages ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 31, 2024 6:23am
TheShadowEevee commented 3 weeks ago

Mentioning @FizzyApple12 since you were involved with a small part of this

TheShadowEevee commented 3 weeks ago

Fixed that mess with the formatting (and corrected the missing .prettierrc in #43)