优化字符串生成

This commit is contained in:
白茶清欢 2021-08-14 23:51:41 +08:00
parent 9100303a3b
commit f62e82ecd0

View File

@ -24,8 +24,8 @@ func GenRandomString(source string, length uint) string {
return ""
}
if len(source) == 0 {
//字符串为空,默认字符源为如下:
source = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
//字符串为空,默认字符源为如下(去除易混淆的i/l):
source = "0123456789abcdefghjkmnopqrstuvwxyzABCDEFGHJKMNOPQRSTUVWXYZ"
}
strByte := []byte(source)
var genStrByte = make([]byte, 0)