Skip to content

neptulon/randstr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Random String

Build Status GoDoc

Random string generator of arbitrary size.

Example

import (
	"github.com/neptulon/randstr"
)

func main() {
	str := randstr.Get(96)
	// str: "VkNT!pQXdtHgyffWMIqNZcnOECWhVYYafBGTDjJvE  PlyaWs!UKiKxGQkquNafewfcU ECXgQfYtyZkFIXEJmIYVPRYaIzh"
}

Alphabet

The default alphabet contains 'space', 'dot', 'exclamation mark', and upper and lowercase English alphabetic characters:

var Alphabet = []rune(". !abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")

You can replace the alphabet used in creating the random string via reassigning the Alphabet variable:

randstr.Alphabet = []rune("abcdefg1234567")

License

MIT

About

Random string generator of arbitrary size.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages