Coder Social home page Coder Social logo

password-generator's Introduction

Password Generator

Description

This is an app that generates a random password according to the user criteria. The app starts by asking the user to input the required password length. The length needs to be between 8 and 128. The app then asks the user to choose the character groups to include in the password. The user need to select at least one character group from numbers, lower case characters, upper case characters and special characters. The program then generates the password by randomly selecting characters from the selected character groups.

Click here to the view the deployed website on github-pages

Table of Contents

Application logic and code

Variables declaration

Input password length

The app displays a prompt window asking the user to input a valid number between 8 and 128. This will be the required password length and is assigned to the variable passwordLength. The while loop insures that the input value is a valid number and is in the range of 8 and 128. Otherwise the loop will keep prompting the user until a valid input is entered.

Input character group inclusion criteria.

The app asks the user to select at least one character group to include in the password using a series of confirms. If the user selects a group, the boolean flag for this group will be set to true. The while loop ensures that at least one group is selected by the user by examining the 4 categories flags. if all of them are false, it will keep looping until the user selects at least one category.

Valid string creation

The app constructs a string containing all the character groups selected by the user by concatenating the selected groups into one string using ternary operation.

Password generation.

In a for loop with the password length as the iteration times. The app generates a random number in the range of 0 to the last index of the valid string to be used as an index to pick random characters from the valid string and concatenates it to the password string. The function finally returns the password to be displayed to the user. and the app is now ready to generate another password.

References

Password Special Characters

password-generator's People

Contributors

mohamedzakigithub avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.