passgo

package module
v0.0.0-...-1cc1b35 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2014 License: GPL-3.0 Imports: 4 Imported by: 0

README

passgo

A human password generator package written in Go. It is based on Pradeep Kishore Gowda's nicepass.py.

Usage

package main

import (
	"fmt"
	"github.com/prinsmike/passgo"
)

func main() {

	c := []byte("bcdfghjklmnpqrstvwxyz")
	v := []byte("aeiou")
	n := []byte("0123456789")
	s := []byte("!@$#%&*-_.")
	gen := passgo.NewGenerator(c, v, n, s, true, 8)
	pass, _ := gen.NewPassword(10, 2, 1)
	fmt.Println(pass)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator struct {
	Consonants     []byte
	Vowels         []byte
	Numbers        []byte
	SpecialChars   []byte
	Capitalize     bool
	CapitalizeOdds int
	// contains filtered or unexported fields
}

func NewDefaultGenerator

func NewDefaultGenerator(caps bool, odds int) (g *Generator)

func NewGenerator

func NewGenerator(cons, vows, nums, specs []byte, caps bool, odds int) (g *Generator)

func (*Generator) NewPassword

func (g *Generator) NewPassword(pLen, nLen, sLen int) (s string, err error)

func (*Generator) ToUpper

func (g *Generator) ToUpper(char []byte) byte

func (*Generator) WriteChar

func (g *Generator) WriteChar(slice []byte) error

func (*Generator) WriteNums

func (g *Generator) WriteNums(nLen int) error

func (*Generator) WriteSpecialChars

func (g *Generator) WriteSpecialChars(sLen int) error

func (*Generator) WriteWord

func (g *Generator) WriteWord(wLen int) error

Jump to

Keyboard shortcuts

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