-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3ac1c32
commit a85cf53
Showing
5 changed files
with
120 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,37 @@ | ||
# go-mrz-scanner | ||
# go-mrz-scanner | ||
|
||
Utility package to validate and parse the MRZ string. | ||
|
||
## Installation | ||
To install this package, run: | ||
```shell | ||
go get -u github.com/okieraised/go-mrz-scanner | ||
``` | ||
|
||
## Usage | ||
Below is an example to parse the MRZ components: | ||
```go | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
go_mrz_parser "github.com/okieraised/go-mrz-scanner" | ||
"log" | ||
) | ||
|
||
func main() { | ||
|
||
input := []string{ | ||
"I<UTOD231458907<<<<<<<<<<<<<<<", | ||
"7408122F1204159UTO<<<<<<<<<<<6", | ||
"ERIKSSON<<ANNA<MARIA<<<<<<<<<<", | ||
} | ||
|
||
parser := go_mrz_parser.NewMRZLineParser(input) | ||
result, err := parser.Parse() | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
fmt.Println(result) | ||
} | ||
``` |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
go_mrz_parser "github.com/okieraised/go-mrz-scanner" | ||
"log" | ||
) | ||
|
||
func main() { | ||
|
||
input := []string{ | ||
"I<UTOD231458907<<<<<<<<<<<<<<<", | ||
"7408122F1204159UTO<<<<<<<<<<<6", | ||
"ERIKSSON<<ANNA<MARIA<<<<<<<<<<", | ||
} | ||
|
||
parser := go_mrz_parser.NewMRZLineParser(input) | ||
result, err := parser.Parse() | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
fmt.Println(result) | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
go_mrz_parser "github.com/okieraised/go-mrz-scanner" | ||
"log" | ||
) | ||
|
||
func main() { | ||
|
||
input := []string{ | ||
"I<UTOD231458907<<<<<<<<<<<<<<<", | ||
"7408122F1204159UTO<<<<<<<<<<<6", | ||
"ERIKSSON<<ANNA<MARIA<<<<<<<<<<", | ||
} | ||
|
||
parser := go_mrz_parser.NewMRZLineParser(input) | ||
result, err := parser.Parse() | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
fmt.Println(result) | ||
} |
This file contains 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