Skip to content

IBAN, National Id, Bank Credit Card Number and Mobile Phone validator package

Notifications You must be signed in to change notification settings

RezaOptic/IRValidator-go

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

travis build, test N|Boom

Installation

Just use go get.

go get github.com/AmirSoleimani/IRValidator

And then just import the package into your own code.

import (
	"github.com/AmirSoleimani/IRValidator/validate"
)

Usage

import (
	"fmt"

	iv "github.com/AmirSoleimani/IRValidator/validate"
)

func main() {
	// CardNumber check
	if err := iv.CardNumber("6221061049447982"); err != nil {
		fmt.Println(err)
	}

	// NationalID check
	if err := iv.NationalID("1111111111"); err != nil {
		fmt.Println(err)
	}

	// IBAN check
	if err := iv.IBAN("IR340570030280001175105001"); err != nil {
		fmt.Println(err)
	}
	
	// MobilePhone check
    	if PhoneNumber, err := validate.MobilePhone("+989121111111"); err != nil {
    		fmt.Println(err)
    	} else {
    		fmt.Println(PhoneNumber)
    	}
}

Releases

No releases published

Packages

No packages published

Languages

  • Go 99.6%
  • Makefile 0.4%