testprint
This commit is contained in:
@@ -31,7 +31,8 @@ func init() {
|
||||
}
|
||||
|
||||
var (
|
||||
letterBytes = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
letterBytes = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
letterBytesNum = "0123456789"
|
||||
)
|
||||
|
||||
func RandStringBytes(n int) string {
|
||||
@@ -42,6 +43,14 @@ func RandStringBytes(n int) string {
|
||||
return string(b)
|
||||
}
|
||||
|
||||
func RandStringBytesWithNumber(n int) string {
|
||||
b := make([]byte, n)
|
||||
for i := range b {
|
||||
b[i] = letterBytesNum[rand.Intn(len(letterBytesNum))]
|
||||
}
|
||||
return string(b)
|
||||
}
|
||||
|
||||
func Captcha(c *gin.Context, length ...int) {
|
||||
l := captcha.DefaultLen
|
||||
w, h := 107, 36
|
||||
|
||||
Reference in New Issue
Block a user