aboutsummaryrefslogtreecommitdiff
path: root/passgen/random
diff options
context:
space:
mode:
Diffstat (limited to 'passgen/random')
-rw-r--r--passgen/random/src/main/kotlin/app/passwordstore/passgen/random/RandomPasswordGenerator.kt11
-rw-r--r--passgen/random/src/main/kotlin/app/passwordstore/passgen/random/RandomPhonemesGenerator.kt13
2 files changed, 11 insertions, 13 deletions
diff --git a/passgen/random/src/main/kotlin/app/passwordstore/passgen/random/RandomPasswordGenerator.kt b/passgen/random/src/main/kotlin/app/passwordstore/passgen/random/RandomPasswordGenerator.kt
index ddb6809c..80e5e583 100644
--- a/passgen/random/src/main/kotlin/app/passwordstore/passgen/random/RandomPasswordGenerator.kt
+++ b/passgen/random/src/main/kotlin/app/passwordstore/passgen/random/RandomPasswordGenerator.kt
@@ -11,17 +11,16 @@ internal object RandomPasswordGenerator {
/**
* Generates a random password of length [targetLength], taking the following flags in [pwFlags]
* into account, or fails to do so and returns null:
- *
* - [PasswordGenerator.DIGITS]: If set, the password will contain at least one digit; if not set,
- * the password will not contain any digits.
+ * the password will not contain any digits.
* - [PasswordGenerator.UPPERS]: If set, the password will contain at least one uppercase letter;
- * if not set, the password will not contain any uppercase letters.
+ * if not set, the password will not contain any uppercase letters.
* - [PasswordGenerator.LOWERS]: If set, the password will contain at least one lowercase letter;
- * if not set, the password will not contain any lowercase letters.
+ * if not set, the password will not contain any lowercase letters.
* - [PasswordGenerator.SYMBOLS]: If set, the password will contain at least one symbol; if not
- * set, the password will not contain any symbols.
+ * set, the password will not contain any symbols.
* - [PasswordGenerator.NO_AMBIGUOUS]: If set, the password will not contain any ambiguous
- * characters.
+ * characters.
*/
fun generate(targetLength: Int, pwFlags: Int): String? {
val bank =
diff --git a/passgen/random/src/main/kotlin/app/passwordstore/passgen/random/RandomPhonemesGenerator.kt b/passgen/random/src/main/kotlin/app/passwordstore/passgen/random/RandomPhonemesGenerator.kt
index 7b62ea4b..8ca196f7 100644
--- a/passgen/random/src/main/kotlin/app/passwordstore/passgen/random/RandomPhonemesGenerator.kt
+++ b/passgen/random/src/main/kotlin/app/passwordstore/passgen/random/RandomPhonemesGenerator.kt
@@ -69,18 +69,17 @@ internal object RandomPhonemesGenerator {
/**
* Generates a random human-readable password of length [targetLength], taking the following flags
* in [pwFlags] into account, or fails to do so and returns null:
- *
* - [PasswordGenerator.DIGITS]: If set, the password will contain at least one digit; if not set,
- * the password will not contain any digits.
+ * the password will not contain any digits.
* - [PasswordGenerator.UPPERS]: If set, the password will contain at least one uppercase letter;
- * if not set, the password will not contain any uppercase letters.
+ * if not set, the password will not contain any uppercase letters.
* - [PasswordGenerator.LOWERS]: If set, the password will contain at least one lowercase letter;
- * if not set and [PasswordGenerator.UPPERS] is set, the password will not contain any lowercase
- * characters; if both are not set, an exception is thrown.
+ * if not set and [PasswordGenerator.UPPERS] is set, the password will not contain any lowercase
+ * characters; if both are not set, an exception is thrown.
* - [PasswordGenerator.SYMBOLS]: If set, the password will contain at least one symbol; if not
- * set, the password will not contain any symbols.
+ * set, the password will not contain any symbols.
* - [PasswordGenerator.NO_AMBIGUOUS]: If set, the password will not contain any ambiguous
- * characters.
+ * characters.
*/
fun generate(targetLength: Int, pwFlags: Int): String? {
require(pwFlags hasFlag PasswordGenerator.UPPERS || pwFlags hasFlag PasswordGenerator.LOWERS)