优化字符串生成
This commit is contained in:
parent
9100303a3b
commit
f62e82ecd0
@ -24,8 +24,8 @@ func GenRandomString(source string, length uint) string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
if len(source) == 0 {
|
if len(source) == 0 {
|
||||||
//字符串为空,默认字符源为如下:
|
//字符串为空,默认字符源为如下(去除易混淆的i/l):
|
||||||
source = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
source = "0123456789abcdefghjkmnopqrstuvwxyzABCDEFGHJKMNOPQRSTUVWXYZ"
|
||||||
}
|
}
|
||||||
strByte := []byte(source)
|
strByte := []byte(source)
|
||||||
var genStrByte = make([]byte, 0)
|
var genStrByte = make([]byte, 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user