gomykad

module
v0.0.0-...-d821b26 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2020 License: MIT

README

gomykad

Go builds Go Report Card Go Doc

A package to generate, validate and represent Malaysian Identity Card (MyKAD) numbers in Go.

Import

To import the package use:

 go get github.com/ShiraazMoollatjie/gomykad/pkg/mykad

Representation

You can represent a MyKAD using a formatted or unformatted NRIC number. A represented MyKAD number can be assumed to be validated.

Formatted NRIC

m, err := NewMyKAD("721212-24-3221")

Unformatted NRIC

m, err := NewMyKAD("721212243221")

Validation

Validates a MyKAD NRIC number.

err := Validate("721212-24-3221")

Generation

It is also possible to generate random MyKAD numbers. This is very useful if you need to test random MyKAD numbers.

m := Generate()

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL