// NewNickname
// lenght 用户名随机部分长度
func NewNickname(lenght int) string {
bytes := []byte("abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ")
result := []byte{}
l := len(bytes)
for i := 0; i < lenght; i++ {
result = append(result, bytes[rand.Intn(l)])
}
return "user_" + string(result)
}
lenght 长度越长,重复的概率越小