Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:add options for password generation (Issue #318) #321

Merged
merged 3 commits into from
Nov 23, 2023

Conversation

qmohitsingh
Copy link
Contributor

@qmohitsingh qmohitsingh commented Nov 23, 2023

Description(Issue #318)
This pull request introduces an improvement to the Internet::password function in the faker library. It adds a new layer of customization to password generation by allowing users to specify the types of characters they want to include in the generated passwords.

Changes Made
Introduced PasswordOptions Struct: A new struct PasswordOptions has been added with boolean fields: upperLetters, lowerLetters, numbers, and symbols. These fields allow users to specify whether they want the corresponding character types included in their password.

Updated Internet::password Function: The password function now accepts an optional PasswordOptions struct. The function generates a password based on the specified character types. By default, all character types are included.

Utilization of Predefined Character Sets: The function leverages predefined character sets from Characters.h for upper case letters, lower case letters, and numeric characters. A set of symbol characters has been defined within Internet.cpp to cater to the symbols option.

include/faker-cxx/Internet.h Outdated Show resolved Hide resolved
include/faker-cxx/Internet.h Outdated Show resolved Hide resolved
include/faker-cxx/Internet.h Outdated Show resolved Hide resolved
src/modules/internet/Internet.cpp Outdated Show resolved Hide resolved
src/modules/internet/Internet.cpp Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4486fba) 98.47% compared to head (338f69c) 98.61%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #321      +/-   ##
==========================================
+ Coverage   98.47%   98.61%   +0.13%     
==========================================
  Files          47       47              
  Lines        2953     2953              
==========================================
+ Hits         2908     2912       +4     
+ Misses         45       41       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cieslarmichal cieslarmichal merged commit 111f95b into cieslarmichal:main Nov 23, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants