Skip to content

intelligentpos/tokengen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tokengen

Build Status Coverage Status GoDoc Go Report Card

tokengen is small, simple and flexible token generator. tokengen allows you to specify your character set and token length, and as such is ideally suited for generating secure tokens in any language, random urls, passwords, and access tokens.

tokengen relies on the crypto/rand package, mapping values evenly to the character set given, disregarding any values out of range.

func GenerateOneTimePassword() (string, error){
    tokengen, err := tokengen.New(tokengen.DefaultCharset, 40)
    if err != nil {
        return tokengen, err
    }
    return tokengen.GenerateToken()
}

Please make sure that the character set and length of token you choose are large enough to ensure a reasonable amount of entropy.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages