public static String randomString(final int size) {
        val builder = new StringBuilder();
        while (builder.length() < size) {
            val suffix = UUID.randomUUID().toString().replace("-", Pac4jConstants.EMPTY_STRING);
            builder.append(suffix);
        }
        return builder.substring(0, size);
    }
Return a random string of a certain size.

@param size the size
@return the random size
pac4j-core/src/main/java/org/pac4j/core/util/CommonHelper.java