func (g *Generator) Generate(length int, noDigits, noSymbols, allowRepeat bool) (string, error) {

	chars := g.letters
	if !noDigits {
		chars = chars + g.digits
	}

	if !noSymbols {
		chars = chars + g.symbols
	}

	var result string

	// Characters
	for i := 0; i < length; i++ {
		ch := randomLetter(g.randomizer, chars)

		if !allowRepeat && strings.Contains(result, ch) {
			i--
			continue
		}

		result = randomInsert(g.randomizer, result, ch)
	}

	return result, nil
}
// Generate generates a password with the given requirements. length is the
// total number of characters in the password. numDigits is the number of digits
// to include in the result. numSymbols is the number of symbols to include in
// the result. noUpper excludes uppercase letters from the results. allowRepeat
// allows characters to repeat.
//
// The algorithm is fast, but it's not designed to be performant; it favors
// entropy over speed. This function is safe for concurrent use.
Generate generates a password with the given requirements. length is the
total number of characters in the password. numDigits is the number of digits
to include in the result. numSymbols is the number of symbols to include in
the result. noUpper excludes uppercase letters from the results. allowRepeat
allows characters to repeat.

The algorithm is fast, but it's not designed to be performant; it favors
entropy over speed. This function is safe for concurrent use.
// Generate generates a password with the given requirements . length is the // total number of characters in the password . numDigits is the number of digits // to include in the result . numSymbols is the number of symbols to include in // the result . noUpper excludes uppercase letters from the results . allowRepeat // allows characters to repeat . // // The algorithm is fast but it ' s not designed to be performant ; it favors // entropy over speed . This function is safe for concurrent use .
func (g *Generator) Generate(length int, noDigits, noSymbols, allowRepeat bool) (string, error) {
	chars := g.letters
	if !noDigits {
		chars = chars + g.digits
	}
	if !noSymbols {
		chars = chars + g.symbols
	}
	var result string
	for i := 0; i < length; i++ {
		ch := randomLetter(g.randomizer, chars)
		if !allowRepeat && strings.Contains(result, ch) {
			i--
			continue
		}
		result = randomInsert(g.randomizer, result, ch)
	}
	return result, nil
}
func ( g * Generator ) Generate ( length int , noDigits , noSymbols , allowRepeat bool ) ( string , error ) { chars := g . letters if ! noDigits { chars = chars + g . digits } if ! noSymbols { chars = chars + g . symbols } var result string for i := 0 ; i < length ; i ++ { ch := randomLetter ( g . randomizer , chars ) if ! allowRepeat && strings . Contains ( result , ch ) { i -- continue } result = randomInsert ( g . randomizer , result , ch ) } return result , nil }
Generate generates a password with the given requirements.
Generate generates a password with the given requirements .
// Characters