Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

a simple way to generate random string with golang

License

Notifications You must be signed in to change notification settings

luliangce/randstr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

2 Commits

Repository files navigation

RandStr

a common way to generate a random string with simple setup

package main
import (
 "github/luliangce/randstr"
 "log"
)
func main() {
 c := randstr.New(10).DisableLetter().EnableNum().Disablesymbol()
 log.Println(c.String())
}

by default:

const letter = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" //enabled
const number = "0123456789" //disabled
const symbol = `!@#$%^&*()-+=,./;'[]\<>?:"{}|` //disabled

About

a simple way to generate random string with golang

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

AltStyle によって変換されたページ (->オリジナル) /