Skip to content

A Golang package to generate random strings and numbers.

License

Notifications You must be signed in to change notification settings

wisdommatt/randgen

Repository files navigation

randgen

A Golang package to generate random strings and numbers.

Installation


go get github.com/wisdommatt/randgen

Features


  • Generate random strings.
  • Generate random numbers.

Requirements


go 1.5

Documentation


https://pkg.go.dev/github.com/wisdommatt/randgen

How to use (examples)


  • Generating 10 random strings.

stringGenerator := randgen.NewStringGenerator()
randomString := stringGenerator.GenerateFromSource(randgen.StringAlphaNumericSource, 10) // source, length
  • Generating 8 random numbers.

numberGenerator := randgen.NewNumberGenerator()
randomNumbers := numberGenerator.GenerateFromSource(randgen.NumberSource, 8) // source,