MCPcopy Create free account
hub / github.com/OWASP/SecurityShepherd / randomString

Method randomString

src/main/java/utils/Hash.java:121–139  ·  view source on GitHub ↗

Creates a psedorandom string @return Random String

()

Source from the content-addressed store, hash-verified

119 * @return Random String
120 */
121 public static String randomString()
122 {
123 String result = new String();
124 try
125 {
126 byte byteArray[] = new byte[16];
127 SecureRandom psn1 = SecureRandom.getInstance("SHA1PRNG");
128 psn1.setSeed(psn1.nextLong());
129 psn1.nextBytes(byteArray);
130 BigInteger bigInt = new BigInteger(byteArray);
131 result = bigInt.toString();
132 log.debug("Generated String = " + result);
133 }
134 catch(Exception e)
135 {
136 log.error("Random Number Error : " + e.toString());
137 }
138 return result;
139 }
140}

Callers 6

doPostMethod · 0.95
doPostMethod · 0.95
doPostMethod · 0.95
doPostMethod · 0.95
doPostMethod · 0.95
doPostMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected