idcardutil

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAgeByIdCard

func GetAgeByIdCard(idCard string, currentDate time.Time) (int, error)

GetAgeByIdCard 获取年龄

func GetBirthByIdCard

func GetBirthByIdCard(idCard string) (string, error)

GetBirthByIdCard 获取生日

func GetGenderByIdCard

func GetGenderByIdCard(idCard string) (string, error)

GetGenderByIdCard 获取性别

func GetRegionByIdCard

func GetRegionByIdCard(idCard string) (string, error)

GetRegionByIdCard 获取省份和城市

func IsValidCard

func IsValidCard(idCard string) bool

IsValidCard 验证身份证是否合法

Types

type City

type City struct {
	Code  string     `json:"code"`
	Label string     `json:"label"`
	List  []District `json:"list"`
}

type District

type District struct {
	Code  string `json:"code"`
	Label string `json:"label"`
}

type Province

type Province struct {
	Code  string `json:"code"`
	Label string `json:"label"`
	List  []City `json:"list"`
}

Province 省、市、区的结构体

Jump to

Keyboard shortcuts

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