Skip to content

Latest commit

 

History

History
35 lines (26 loc) · 954 Bytes

README.md

File metadata and controls

35 lines (26 loc) · 954 Bytes

pwgen

Build Status Go Report Card

Go library to generate a random string of a given length

Installation

This package can be installed using the "go get" command

go get github.com/chr4/pwgen

Usage

package main

import (
    "fmt"
    "github.com/chr4/pwgen"
)

func main() {
    // The following functions will generate 20 chars long passwords out of
    fmt.Print(pwgen.New(20, "ab"))       // a's and b's
    fmt.Print(pwgen.Num(20))             // numbers
    fmt.Print(pwgen.Alpha(20))           // alphabets
    fmt.Print(pwgen.Symbols(20))         // symbols
    fmt.Print(pwgen.AlphaNum(20))        // alphanumeric characters
    fmt.Print(pwgen.AlphaNumSymbols(20)) // alphanumeric characters and symbols
}