lib/verified/parser/mrz/check.rb in verified-1.3.0 vs lib/verified/parser/mrz/check.rb in verified-1.3.1
- old
+ new
@@ -4,9 +4,14 @@
@@digit_checker = CheckDigit.new
@@date_converter = YYDate.new
end
def check(mrz_line_1, mrz_line_2)
+
+ if mrz_line_1.length != 44 && mrz_line_2.length != 44
+ return false
+ end
+
# Read the first line without chevrons
split = mrz_line_1.split(/<+/)
doc_data = Hash.new(9)
doc_data["issuing_state"] = mrz_line_1[2...5].sub(/<+/, '')
\ No newline at end of file