File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change
1
+ /* eslint-disable no-plusplus */
1
2
/* eslint-disable no-param-reassign */
2
- // eslint-disable-next-line import/no-unresolved, import/extensions
3
+ /* eslint-disable import/extensions */
4
+ /* eslint-disable import/no-unresolved */
5
+ import getCharPool from './characterspool' ;
3
6
import { Options } from './options' ;
7
+ import getRandomNumber from './randomnumber' ;
4
8
5
9
function generate ( options : Options ) : string {
6
10
// Set default values for options
@@ -20,7 +24,14 @@ function generate(options: Options): string {
20
24
)
21
25
options . excludeSimilarCharacters = false ;
22
26
23
- return '' ;
27
+ const charPool = getCharPool ( options ) ;
28
+
29
+ let password = '' ;
30
+ for ( let i = 0 ; i < ( options . length as number ) ; i ++ ) {
31
+ password += charPool [ getRandomNumber ( charPool . length ) ] ;
32
+ }
33
+
34
+ return password ;
24
35
}
25
36
26
37
export default generate ;
You can’t perform that action at this time.
0 commit comments