Noah Petherbridge
8f60bdba0e
* Add configuration system and default public channels support * Add support for multiple channels and DM threads with users, with unread badge indicators. DMs rearrange themselves by most recently updated on top. * Responsive CSS to work well on mobile devices.
14 lines
300 B
Go
14 lines
300 B
Go
package util
|
|
|
|
import "math/rand"
|
|
|
|
// RandomString returns a random string of any length.
|
|
func RandomString(n int) string {
|
|
const charset = "abcdefghijklmnopqrstuvwxyz"
|
|
var result = make([]byte, n)
|
|
for i := 0; i < n; i++ {
|
|
result[i] = charset[rand.Intn(len(charset))]
|
|
}
|
|
return string(result)
|
|
}
|