gotcvalidate

package module
v0.0.0-...-9c0b654 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2017 License: GPL-2.0 Imports: 1 Imported by: 0

README

#Turkish Identification Number Validation

Validation of Turkish Identification Number in golang

GoDoc

The identification number is a unique 11-digit number given by the MERNIS computer on the basis of the citizen's registration record that is kept by the registration office. The number does not reflect any personal information about the citizen. It is not possible to change the identification number once applied.

http://www.nvi.gov.tr/English/Mernis_EN,Mernis_En.html?pageindex=1

#Usage:

Check main file in test folder or follow this code:

go get github.com/aligoren/gotcvalidate

and import your project

import "github.com/aligoren/gotcvalidate"

#Sample Usage:

package main

import (
    "fmt"
    "github.com/aligoren/gotcvalidate"
)

func main() {
    /* initialize TCValidate (TCValidate) */
    ti := gotcvalidate.TCValidate{}
    /* First number was given to Atatürk, which is 10000000146. */
    if ti.TiValidate("10000000146") {
        fmt.Println("True")
    }else{
        fmt.Println("False")
    }
}

Run your test code

go run main.go

True

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TCValidate

type TCValidate struct {
	ATINUM                                     uint64
	BTINUM                                     uint64
	TiNum                                      uint64
	C1, C2, C3, C4, C5, C6, C7, C8, C9, Q1, Q2 uint64
}

func (TCValidate) TiValidate

func (tv TCValidate) TiValidate(number string) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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