pwgen

package module
Version: v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2018 License: GPL-3.0 Imports: 1 Imported by: 6

README

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
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Alpha added in v1.1.0

func Alpha(length int) string

Alpha generates a random string of the given length out of alphabetic characters

func AlphaNum

func AlphaNum(length int) string

AlphaNum generates a random string of the given length out of alphanumeric characters

func AlphaNumSymbols

func AlphaNumSymbols(length int) string

AlphaNumSymbols generates a random string of the given length out of alphanumeric characters and symbols

func New

func New(length int, chars string) string

New generates a random string of the given length out of the characters in char

func Num

func Num(length int) string

Num generates a random string of the given length out of numeric characters

func Symbols added in v1.1.0

func Symbols(length int) string

Symbols generates a random string of the given length out of symbols

Types

This section is empty.

Source Files

Jump to

Keyboard shortcuts

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