Rename package

This commit is contained in:
AsamK 2015-12-13 11:05:08 +01:00
parent 5859e7b9f7
commit 27d9424f1e
17 changed files with 27 additions and 20 deletions

View file

@ -1,25 +0,0 @@
package cli;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
class Util {
public static String getSecret(int size) {
byte[] secret = getSecretBytes(size);
return Base64.encodeBytes(secret);
}
public static byte[] getSecretBytes(int size) {
byte[] secret = new byte[size];
getSecureRandom().nextBytes(secret);
return secret;
}
private static SecureRandom getSecureRandom() {
try {
return SecureRandom.getInstance("SHA1PRNG");
} catch (NoSuchAlgorithmException e) {
throw new AssertionError(e);
}
}
}