fix: return exact scanned MRZ + full Guatemala document number#11
Draft
haklyray wants to merge 1 commit into
Draft
fix: return exact scanned MRZ + full Guatemala document number#11haklyray wants to merge 1 commit into
haklyray wants to merge 1 commit into
Conversation
Records now keep the exact parsed (cleaned) MRZ in MrzRecord.rawMrz, so callers can return the scanned value verbatim instead of the lossy toMrz() reconstruction — which rebuilds line 1 with a fixed 9-char document-number field and truncates overflow numbers such as the 11-digit Dominican cédula. Guatemala_ID now appends the 4 extra document-number digits carried in the optional field (new DPI format) to produce the full 13-digit number, falling back to the 9-digit field when those 4 chars are not digits (older cards). Modernize the parser module build (namespace, compileSdk 34, Java 21) so it builds from source under a current AGP; add MrzParserFixTest covering rawMrz and the GTM 9/13 rule.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
MrzRecord.rawMrz— records now keep the exact parsed (cleaned) MRZ string. Callers can return the scanned value verbatim instead of the lossytoMrz()reconstruction, which rebuilds line 1 with a fixed 9-char document-number field and truncates overflow numbers (e.g. the 11-digit Dominican cédula).toMrz()is left intact but documented as lossy.documentNumber(9 → 13) —Guatemala_IDnow appends the 4 extra document-number digits carried in the optional field (new DPI format) for the full 13-digit number, falling back to the 9-digit field when those 4 chars are not digits (older cards).parser/build.gradleupdated (namespace,compileSdk 34, Java 21) so the parser builds from source under a current AGP, and can be consumed as a source submodule bysmartscanner-core.Tests
MrzParserFixTest:rawMrzround-trip, DOM 11-digit document number preserved, GTM new-format → 13 digits, GTM old-format → 9 digits. Verified via:smartscanner-mrz-parser:testDebugUnitTest(built through smartscanner-core's AGP 9 / Gradle 9.1 toolchain).Notes
build.gradle(Gradle 6.5 / jcenter); modernizing the root + wrapper is a follow-up. No CI is configured here today.