Documentation ¶
Index ¶
- Constants
- Variables
- type IdNumber
- func (o *IdNumber) GenerateId(sex int) string
- func (o *IdNumber) GetAge() int
- func (o *IdNumber) GetAreaName() string
- func (o *IdNumber) GetBirthDay() string
- func (o *IdNumber) GetCheckDigit() string
- func (o *IdNumber) GetSex() int
- func (o *IdNumber) Init(idNumber string) *IdNumber
- func (o *IdNumber) VerifyId(idNumber string) (is bool)
Constants ¶
View Source
const ( // 十五位身份证号表达式 ID_NUMBER_15_REGEX = `^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}$` // 十八位身份证号表达式 identity_util ID_NUMBER_18_REGEX = `^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$` )
Variables ¶
View Source
var ( AREA_INFO = map[string]string{}/* 3465 elements not displayed */ Tg = [10]string{"甲", "乙", "丙", "丁", "戊", "己", "庚", "辛", "壬", "癸"} //天干 Fz = [10]string{"甲", "乙", "丙", "丁", "戊", "己", "庚", "辛", "壬", "癸"} //地支 Zodiac = [12]string{"子鼠", "丑牛", "寅虎", "卯兔", "辰龙", "巳蛇", "午马", "未羊", "申猴", "酉鸡", "戌狗", "亥猪"} //地支 )
区域信息
Functions ¶
This section is empty.
Types ¶
type IdNumber ¶
var IdCard IdNumber
func (*IdNumber) GenerateId ¶
func (*IdNumber) GetAreaName ¶
func (*IdNumber) GetBirthDay ¶
func (*IdNumber) GetCheckDigit ¶
Click to show internal directories.
Click to hide internal directories.