package main
import (
"fmt"
"encoding/base64"
"crypto/rand"
)
func randomString(n int) (string, error) {
data := make([]byte, n)
_, err := rand.Read(data)
if err != nil {
return "", nil
}
return base64.StdEncoding.EncodeToString(data), nil
}
func main() {
d, err := randomString(24)
fmt.Println(d, err)
}
To embed this program on your website, copy the following code and paste it into your website's HTML: