Skip to content

InheritxSolution/password-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Password Generator

This package provides a secure and customizable password generator in Go. It allows you to generate random passwords with optional parameters to include uppercase letters, numbers, and special characters.


Usage

package main

import (
	"fmt"
	password "github.com/InheritxSolution/password-generator"
)

func main() {
	// Generate a password with default options (length 12, lowercase only)
	pass1, err := password.GeneratePassword()
	if err != nil {
		fmt.Println("Error generating password:", err)
		return
	}
	fmt.Println("Default Password:", pass1)

	// Generate a password with custom options
	pass2, err := password.GeneratePassword(
		password.WithLength(16),
		password.WithUpper(),
		password.WithNumbers(),
		password.WithSpecial(),
	)
	if err != nil {
		fmt.Println("Error generating password:", err)
		return
	}
	fmt.Println("Custom Password:", pass2)
}

About

This package provides a secure and customizable password generator in Go.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages