Package org.rapidcontext.core.security
Class Random
java.lang.Object
org.rapidcontext.core.security.Random
Helper methods for random data, useful for secrets and keys.
-
Method Summary
-
Method Details
-
bytes
public static byte[] bytes(int size) Creates an array with random bytes.- Parameters:
size- the array size (in bytes)- Returns:
- the byte array
-
base64
Creates a Base64 encoded string with random bytes.- Parameters:
size- the number of bytes- Returns:
- the Base64 encoded string
-