You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: strings.go
    path of file: ./repos/coder/cryptorand
    
    the code of the file until where you have to start completion: package cryptorand

import (
	"crypto/rand"
	"encoding/binary"
	"strings"

	"golang.org/x/xerrors"
)

// Charsets
const (
	// Numeric includes decimal numbers (0-9)
	Numeric = "0123456789"

	// Upper is uppercase characters in the Latin alphabet
	Upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

	// Lower is lowercase characters in the Latin alphabet
	Lower = "abcdefghijklmnopqrstuvwxyz"

	// Alpha is upper or lowercase alphabetic characters
	Alpha = Upper + Lower

	// Default is uppe
    
func StringCharset(charSetStr string, size int) (string, error) {
	if size == 0 {
		return "", nil
	}

	if len(charSetStr) == 0 {
		return "", xerrors.Errorf("charSetStr must not be empty")
	}

	charSet := []rune(charSetStr)

	// We pre-allocate the entropy to amortize the crypto/rand syscall overhead.
	entropy := make([]byte, 4*size)

	_, err := rand.Read(entropy)
	if err != nil {
		return "", err
	}

	var buf strings.Builder
	buf.Grow(size)

	for i := 0; i < size; i++ {
		r := binary.BigEndian.Uint32(entropy[:4])
		entropy = entropy[4:]

		ci, err := unbiasedModulo32(
			r,
			int32(len(charSet)),
		)
		if err != nil {
			return "", err
		}

		_, _ = buf.WriteRune(charSet[ci])
	}

	return buf.String(), nil
}