shared/util.go
func RandomCryptoString() (string, error) {
	buf := make([]byte, 32)
	n, err := rand.Read(buf)
	if err != nil {
		return "", err
	}

	if n != len(buf) {
		return "", fmt.Errorf("not enough random bytes read")
	}

	return hex.EncodeToString(buf), nil
}
func RandomCryptoString() (string, error) {
	buf := make([]byte, 32)
	n, err := rand.Read(buf)
	if err != nil {
		return "", err
	}

	if n != len(buf) {
		return "", fmt.Errorf("not enough random bytes read")
	}

	return hex.EncodeToString(buf), nil
}
func RandomCryptoString ( ) ( string , error ) { buf := make ( [ ] byte , 32 ) n , err := rand . Read ( buf ) if err != nil { return " " , err } if n != len ( buf ) { return " " , fmt . Errorf ( " " ) } return hex . EncodeToString ( buf ) , nil }
// Returns a random base64 encoded string from crypto/rand.
Returns a random base64 encoded string from crypto / rand .