Commit graph

7 commits

Author SHA1 Message Date
e17da1a2c9
Improve code readability by refactoring variable names
Several variable names have been changed in 'random.go' to improve overall readability and code comprehension. Additionally, a typo was fixed and a new constant was introduced for the maximum value of Int32, to replace previously hard-coded values. The adjustments not only make the code more digestible, but also adhere to good coding practices.
2024-03-07 23:22:28 +01:00
8f8e439f56
Refactor variable names and correct typos in RandomBytes and RandNum methods
This commit includes refactoring variable names to enhance readability and understanding within the `RandomBytes`, `RandNum` and `RandomStringFromCharRange` methods. A constant, `maxInt32`, was also added to replace a hard-coded value for better code practice. Typos in the comments and documentation were corrected as well.
2024-03-07 22:50:47 +01:00
203da17634
#52 and #53: Increase password generation flexibility and error handling
Added code to check if set minimum password requirements are met after generating a random password. If not, the password generation process is repeated.
This not only adds an extra layer of security but also ensures that all set criteria for the password are met.
Also enhanced error handling in functions that could return a negative integer when asked for a random number.
Changed 'minimum amount of' parameter descriptions in apg.go to avoid confusion.
2023-08-06 18:55:47 +02:00
2822f73f56
#53 Add coinflip algorithm and improve error messages
Introduced a new password generation algorithm, called 'coinflip', which simply returns "Heads" or "Tails". Associated CLI flag has been added as well. Also, improved error messages during password generation. This addition provides a simpler algorithm option and clearer user feedback during errors.
2023-08-05 18:10:11 +02:00
499a82d884
#53 Add fixed length option for password generation
A FixedLength field was added to the Config struct and a corresponding command line flag was added in `apg.go`. The field allows for the generation of passwords of a fixed length, overriding the MinLength and MaxLength values if present. Revised the `random.go` script to accommodate this change. The option for fixed length enhances the flexibility and customization of the password generation tool.
2023-08-05 15:04:34 +02:00
ac97b94ec9
Refactor generator and add config options
Refactored the generator to include a new config option, changed function signatures to follow the new structure, and renamed the function 'RandomString' to 'RandomStringFromCharRange' for clarity. Also, added a new mode and algorithm feature to enhance password generation. Furthermore, added several tests for new features and configurations. Adapted the CLI to use the new configuration approach. This refactoring was necessary to improve the customizability and clarity of the password generation process. Fixed minor issues and added '.gitignore' for clean commits in the future.
2023-08-04 16:02:58 +02:00
e94b1ade5c
v2: Complete rework of the library and the client 2023-04-18 11:49:44 +02:00