GithubHelp home page GithubHelp logo

guanguans / id-validator Goto Github PK

View Code? Open in Web Editor NEW
194.0 3.0 39.0 524 KB

China ID number validator. - **身份证号验证器。

License: MIT License

Go 99.20% Makefile 0.04% PHP 0.76%
verify id idcard idcard-check idcard-generator idcard-detect idcardnumber-validation idcardocr-china validate validation

id-validator's Introduction

id-validator's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

id-validator's Issues

容易发生panic

func Test02(t *testing.T) {
	t.Log(idvalidator.IsLooseValid("010-12345678转152"))
}

stack

--- FAIL: Test02 (0.00s)
panic: runtime error: index out of range [1] with length 0 [recovered]
	panic: runtime error: index out of range [1] with length 0

goroutine 8 [running]:
github.com/guanguans/id-validator.generateLongCode({0xd6f66c, 0x12})
	/home/xxx/go/pkg/mod/github.com/guanguans/[email protected]/checker.go:58 +0x385
github.com/guanguans/id-validator.generateCode({0xd6f66c?, 0xfb502c?})
	/home/xxx/go/pkg/mod/github.com/guanguans/[email protected]/checker.go:24 +0x31
github.com/guanguans/id-validator.IsValid({0xd6f66c?, 0x520a74?}, 0x0?)
	/home/xxx/go/pkg/mod/github.com/guanguans/[email protected]/id_validator.go:32 +0x26
github.com/guanguans/id-validator.IsLooseValid(...)
	/home/xx/go/pkg/mod/github.com/guanguans/[email protected]/id_validator.go:53

goland下不能进行debug模式

Describe the bug
goland调试模式下报错

To Reproduce
goland下进行debug

Expected behavior
能够正常调试程序

Screenshots
image

Additional context

编译异常

go version: 1.17

E:\go\pkg\mod\github.com\guanguans\[email protected]\data\constellation.go:64:6: internal compiler error: NewBulk too big: nbit=63108 count=883526 nword=1973 size=1743196798

您好,请问严格模式与非严格具体什么区别?另外地址区划代码与年份不同的错误身份证能否校验出来?

// 验证身份证号合法性严格模式与非严格具体什么区别?
ffmt.P(idvalidator.IsValid("440308199901101512", false)) // 非严格模式验证大陆居民身份证18位
ffmt.P(idvalidator.IsValid("440308199901101512", true)) // 严格模式验证大陆居民身份证18位

关于校验地址码有效期功能:
例如假身份证号370620199505100123,但是1995年威海地区压根没有370620的地址区划代码。(前六位地址码错误,370620地址码在1987年就废弃了)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.