Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 25 additions & 23 deletions password-generator.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,37 @@
# Password Generator

**Objective:** Create a password generator that can create a secure password.
**Objective:** Create a password generator that produces secure, high-quality passwords suitable for use in authentication systems.

It should be possible to generate a password by calling a method—you may choose
the method signature for this. The method should return a string containing the
new password.
You may define the method signature, but the generator should return a string containing the generated password.

This generation method should accept the following options which define the
requirements of returned passwords:
## Requirements

- `length` — (integer) length of the generated password
- `uppercase` — (boolean) include one or more uppercase `A-Z` characters
- `lowercase` — (boolean) include one or more lowercase `a-z` characters
- `number` — (integer) exact number of numeric `0-9` characters
- `special` — (integer) exact number of special `@%!?*^&` characters
The password generation method must accept the following options:

The function should produce an error in the event of invalid options.
- `length` (integer) - length of the generated password
- `uppercase` (boolean) - include one or more uppercase `A-Z` characters
- `lowercase` (boolean) - include one or more lowercase `a-z` characters
- `number` (integer) - exact number of numeric `0-9` characters
- `special` (integer) - exact number of special `@%!?*^&` characters

External libraries are allowed for testing purposes. The actual password
generation code however should be implemented in your code, and not simply call
out to an external library that generates passwords for you.
The method should raise an error if the options are invalid (e.g. if the total number of required characters exceeds the specified length).

The code should be packaged as a library/module which could be included into
other libraries and applications.
## Constraints

Tests should be included to verify that the code works as intended.
- Passwords should be generated in a way that ensures high entropy and unpredictability.
- You may use any classes or modules available in the standard Ruby library.
- External libraries may be used for testing purposes only. Do not use them to generate passwords.

Documentation should be included to demonstrate how to use the library. A well
written README is more than sufficient. Please add some notes about how you
approached the problem, and any difficulties or issues you encountered during
development.
## Deliverables

Push the library into a private repository on GitHub and invite
- A Ruby module or library that could be reused in other applications.
- A test suite that demonstrates the correctness and robustness of your solution.
- Documentation including:
- Basic usage instructions
- A brief explanation of your approach
- Any considerations or challenges you encountered

## Submission

Push your code into a private repository on GitHub and invite
[@js1300](https://github.com/js1300) and [@jpswade](https://github.com/jpswade) with read access.