-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: changed how characters are generated.
This update changes how the `generateCharCode` function generates characters. The new method will allow for the expansion of more characters by removing the manual `if else` chaining. Furthermore we also removed the `conformPassword` check step as the new method will always ensure the proper number of attributes exists in the password (at the cost of possibly being a bit less random). This update includes the following changes: * The `generateCharCode` function now recieves a new parameter, a `charCodeRequest` object which contains a string that is the desired character we want to generate. The checks are now performed against a `characterCodeConstraints` object which contains the attributes for each character type. * Removed the `conformPassword` function. * Moved all Interfaces, Enums, Lists and Objects into a Data folder. * Removed any currently unused modifiers such as, *memorable* and *special* * Updated the README * Updated the Demo page: * Clarified the character set being used. * Added a warning about excessive use of the *exclude characters* feature * Removed unneeded JavaScript code for the demo * Updates to the `package.json` file: * removed the `main` attribute, replaced with `browser` * Updated version. * Added more directories. * Changed the `license` attribute to `licenses` and added a URL. * Added two new helper functions: * `shuffle` used to shuffle arrays. * `createModifierList` creates a list of modifiers from an object. Signed-off-by: staticBanter <[email protected]>
- Loading branch information
staticBanter
committed
Nov 3, 2022
1 parent
143da60
commit 416dde3
Showing
38 changed files
with
677 additions
and
412 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,10 +4,12 @@ | |
}, | ||
"name": "simplepass", | ||
"description": "simplePass is a Javascript password generator.", | ||
"version": "2.5.1-Development", | ||
"main": "bs-config.js", | ||
"version": "1.0.0-Beta", | ||
"browser": "./simplePass/simplePass.js", | ||
"directories": { | ||
"test": "test" | ||
"test": "test", | ||
"src": "src", | ||
"lib": "simplePass" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
|
@@ -22,7 +24,12 @@ | |
"email": "[email protected]", | ||
"url": "https://staticblogs.ca/users/staticBanter" | ||
}, | ||
"license":"GPL-3.0", | ||
"licenses":[ | ||
{ | ||
"type": "GPL-3.0", | ||
"url": "https://www.gnu.org/licenses/gpl-3.0.html" | ||
} | ||
], | ||
"bugs": { | ||
"url": "https://github.com/staticBanter/simplePass/issues" | ||
}, | ||
|
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
'use strict'; | ||
; | ||
; | ||
export {}; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
'use strict'; | ||
export {}; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
'use strict'; | ||
const L_useableAttributes = [ | ||
'lowercase', | ||
'uppercase', | ||
'numbers', | ||
'punctuation', | ||
'special', | ||
'memorable', | ||
'w_beginning', | ||
'w_end', | ||
'w_between', | ||
'excludeCharacters' | ||
]; | ||
export default L_useableAttributes; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
'use strict'; | ||
const L_whitespaceAttributes = [ | ||
'w_beginning', | ||
'w_end', | ||
'w_between', | ||
'w_end_required', | ||
'w_beginning_required', | ||
]; | ||
export default L_whitespaceAttributes; |
29 changes: 29 additions & 0 deletions
29
simplePass/data/objects/characterCodeConstraints.object.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
'use strict'; | ||
const characterCodeConstraints = { | ||
lowercase: { | ||
min: 97, | ||
max: 122, | ||
}, | ||
uppercase: { | ||
min: 65, | ||
max: 90, | ||
}, | ||
numbers: { | ||
min: 48, | ||
max: 57, | ||
}, | ||
punctuation: { | ||
min: 33, | ||
max: 126, | ||
range: [ | ||
[33, 47], | ||
[58, 64], | ||
[91, 96], | ||
[123, 126] | ||
] | ||
}, | ||
whitespace: { | ||
single: 32 | ||
}, | ||
}; | ||
export default characterCodeConstraints; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
'use strict'; | ||
export default function createModifierList(modifier, list) { | ||
const modifiers = []; | ||
Object.keys(modifier).forEach((key) => { | ||
if (list.includes(key)) { | ||
modifiers.push(key); | ||
} | ||
}); | ||
return modifiers; | ||
} |
Oops, something went wrong.