Arg0s1080 / mrz

Machine Readable Zone generator and checker for official travel documents sizes 1, 2, 3, MRVA and MRVB (Passports, Visas, national id cards and other travel documents)
GNU General Public License v3.0
328 stars 122 forks source link

Issue with georgia passports (td1) #23

Closed ahvahsky2008 closed 3 years ago

ahvahsky2008 commented 3 years ago

lib incorrect calc hash value.

from mrz.generator.td1 import TD1CodeGenerator,dictionary

x1 = 'ID'
x2 = 'GEO'
x3 = '13IN30572'
x4 = '910526'
x5 = 'M'
x6 = '251221'
x7 = 'GEO'
x8 = 'MAMEDOV'
x9 = 'IUKSEL'
x10 ='10011051644'
dictionary.c
text = TD1CodeGenerator(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,force=False)
print(text)        

image

image image

Arg0s1080 commented 3 years ago

Hi!

It seems odd. When I have a little free time I'll check it out (this weekend)

Regards

Arg0s1080 commented 3 years ago

Checked!

Hash calc is correct

You had a typo. If you change 10011051644 by 10001051644 in optional_data field your output will be:

from mrz.generator.td1 import TD1CodeGenerator

x1 = 'ID'
x2 = 'GEO'
x3 = '13IN30572'
x4 = '910526'
x5 = 'M'
x6 = '251221'
x7 = 'GEO'
x8 = 'MAMEDOV'
x9 = 'IUKSEL'
x10 ='10011051644'

text = TD1CodeGenerator(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,force=False)

print(text)

text.optional_data1 = "10001051644"
print()
print(text) 
IDGEO13IN30572210011051644<<<<
9105263M2512211GEO<<<<<<<<<<<3
MAMEDOV<<IUKSEL<<<<<<<<<<<<<<<

IDGEO13IN30572210001051644<<<<
9105263M2512211GEO<<<<<<<<<<<0
MAMEDOV<<IUKSEL<<<<<<<<<<<<<<<

Regards!