utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IdCardAlpha = []int{7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2, 0}
View Source
var IdCardCheckSum = []byte{'1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'}
View Source
var Random = []int64{77006791947779465, 74665223082153637, 29484611666145882,
	37200794235010091, 16589616287113976, 34824724549167383, 5394647632969764,
	43635317331776162, 94385949183117224, 75422040480279476, 14588224549167383}
View Source
var RandomAlpha = []string{"a", "b", "c", "d", "e", "f"}

Functions

func CheckIdCode

func CheckIdCode(idcode string) bool

CheckIdCode 判断身份证号是否合法,返回true合法,返回false不合法

func CheckName

func CheckName(name string) (string, bool)

func Decode

func Decode(codex string) string

func Encode

func Encode(idcode string) string

func Md5

func Md5(str string) string

Types

type IdCard

type IdCard struct {
	CardNum string
	// contains filtered or unexported fields
}

func ConvertOldIdCard

func ConvertOldIdCard(idcard string) *IdCard

func ParseIdCard

func ParseIdCard(idcard string) *IdCard

func (*IdCard) GetAge

func (i *IdCard) GetAge() int

func (*IdCard) GetAgeLevel

func (i *IdCard) GetAgeLevel(mode int) int

Jump to

Keyboard shortcuts

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