randstr

package module
v0.0.0-...-65f7ef0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2015 License: MIT Imports: 2 Imported by: 0

README

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

Documentation

Index

Constants

This section is empty.

Variables

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

Alphabet is the letters used in creating the random string.

Functions

func Get

func Get(n int) string

Get generates a random string sequence of given size.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL