diff options
| author | Harsh Shandilya <msfjarvis@gmail.com> | 2019-01-02 19:30:33 +0530 |
|---|---|---|
| committer | Mohamed Zenadi <zeapo@users.noreply.github.com> | 2019-01-02 15:00:33 +0100 |
| commit | b267321d540984f2f5023f7eefcc475c30d8a0c1 (patch) | |
| tree | 37711e2f99c5bededee2ca762df170e335f11b56 /app/src/main/java/com/zeapo/pwdstore/pwgen/randnum.java | |
| parent | a82fb391d3c6e9b1151664100640114286843ec7 (diff) | |
| download | HardenedPass-b267321d540984f2f5023f7eefcc475c30d8a0c1.tar.gz HardenedPass-b267321d540984f2f5023f7eefcc475c30d8a0c1.zip | |
Rewrite pwgen package in Kotlin (#463)
* Rename classes to not be ugly as all hell
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
* PgpActivity: Cleanup
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
* Rewrite pwgen package in Kotlin
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
* PRNGFixes: Remove constant conditions
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
Diffstat (limited to 'app/src/main/java/com/zeapo/pwdstore/pwgen/randnum.java')
| -rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/pwgen/randnum.java | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/pwgen/randnum.java b/app/src/main/java/com/zeapo/pwdstore/pwgen/randnum.java deleted file mode 100644 index 583d0863..00000000 --- a/app/src/main/java/com/zeapo/pwdstore/pwgen/randnum.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.zeapo.pwdstore.pwgen; - -import java.security.NoSuchAlgorithmException; -import java.security.SecureRandom; - -class randnum { - private static SecureRandom random; - - static { - try { - random = SecureRandom.getInstance("SHA1PRNG"); - } catch (NoSuchAlgorithmException e) { - throw new SecurityException("SHA1PRNG not available", e); - } - } - - /** - * Generate a random number n, where 0 <= n < maxNum. - * - * @param maxNum the bound on the random number to be returned - * @return the generated random number - */ - public static int number(int maxNum) { - return random.nextInt(maxNum); - } -} |
