PasswordGeneratorHelper - NuGET

PasswordGeneratorHelper

What’s PasswordGeneratorHelper?

Password Generator Helper - Do you need one or more RANDOM PASSWORD? This NuGET can help you!

During the last weekend, I released a new NuGET. This NuGET can help you when you need a random password. I wrote the code with netstandard2.1, so you can add this NuGET in your project without problems.

How To Install

If you want to use PasswordGeneratorHelper inside your application, you can only add the nuget in your project.

1
PM> Install-Package PasswordGeneratorHelper 

Did you add PasswordGeneratorHelper in your project? Ok, we are ready to use it!

Password Generator

As first step, we can add the using in your class

1
using PasswordGeneratorHelper;

Constructor

The constructor works in two ways:

  • zero parameter
  • four parameters

If you call without parameters, all parameters are true.

1
2
3
4
5
public PasswordGenerator(
    bool upperCase = true, 
    bool lowerCase = true, 
    bool numericCase = true, 
    bool specialCase = true)
FlagASCII FROMNext Chars
upperCase6526
lowerCase9726
numericCase4810
specialCase3216
specialCase587
specialCase916
specialCase1234

In the ASCII Table the specialCase chars are split in four groups. If you enable this flag, you get all groups.

If all parameters are false, you receive an exception.

Get

The Get method is very simple to use. You can only indicate the password length. As result, you’ll have the new random password.

1
2
PasswordGenerator pg = new PasswordGenerator();
var password = pg.Get( -length- );

Get Min/ Max

This method works as the previous, but you can generate password with a random lenght from minLength to maxLenght lenght.

1
2
PasswordGenerator pg = new PasswordGenerator();
var password =  Get(int minLength, int maxLenght)

CustomException

The namaspace PasswordGeneratorHelper.CustomException contains this exceptions:

  • InvalidCharSetException
  • InvalidPasswordLengthException

Release History

Do you like PasswordGeneratorHelper?

ReleaseLastUpdateNote
2021.193.15.6502021/07/13Get from min to max lenght; CustomException (InvalidCharSetException & InvalidPasswordLengthException); New icon from MeCreativa
2021.186.7.6452021/07/04Core Improvements + NuGET Tags / Icon
2021.183.20.6432021/07/02First minimal version with .Get(-lenght-)

Do you like PasswordGeneratorHelper?