Documentation ¶
Index ¶
- func CheckMenu(pageType int, path string) string
- func CheckPassword(password string) (b bool)
- func CheckUsername(username string) (b bool)
- func DecryptWithRSA(cipherText string, privateKeyPath string) (string, error)
- func Difference(slice1, slice2 []int) []int
- func EncryptWithRSA(plainText string, publicKeyPath string) (string, error)
- func EncryptWithSha256(data string) string
- func GenRandomString(n int, code int) string
- func GenerateFeatureLabel(url string) string
- func GenerateRSAKey(bits int) error
- func Intersect(slice1, slice2 []int) []int
- func StructToJson(Struct interface{}) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckUsername ¶
CheckUsername 验证名称 必须是、下划线、@、.和6-10位之间的字母
func DecryptWithRSA ¶
DecryptWithRSA rsa解密
func EncryptWithRSA ¶
EncryptWithRSA rsa加密
func GenRandomString ¶
GenRandomString 生成随机字符串或数字验证码,n表示要生成的字符串长度,code表示类型,1 数字验证码,2 随机字符串 https://colobu.com/2018/09/02/generate-random-string-in-Go/
func GenerateFeatureLabel ¶
func GenerateRSAKey ¶
GenerateRSAKey 生成私钥和公钥, bits参数指定证书大小 也可以直接通过openssl命令生成: 私钥:openssl genrsa -out rsa_private_key.pem 2048 公钥:openssl rsa -in rsa_private_key.pem -pubout -out rsa_public_key.pem
func StructToJson ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.