MCPcopy Create free account
hub / github.com/jwtk/jjwt / random

Method random

impl/src/main/java/io/jsonwebtoken/impl/lang/Bytes.java:43–50  ·  view source on GitHub ↗
(int numBytes)

Source from the content-addressed store, hash-verified

41 }
42
43 public static byte[] random(int numBytes) {
44 if (numBytes <= 0) {
45 throw new IllegalArgumentException("numBytes argument must be >= 0");
46 }
47 byte[] bytes = new byte[numBytes];
48 Randoms.secureRandom().nextBytes(bytes);
49 return bytes;
50 }
51
52 public static byte[] toBytes(int i) {
53 return new byte[]{

Callers 1

randomBitsMethod · 0.95

Calls 2

secureRandomMethod · 0.95
nextBytesMethod · 0.80

Tested by

no test coverage detected