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)
}

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: