public String generateNonce() {
        return Base64.getEncoder().encodeToString(UUID.randomUUID().toString().getBytes(StandardCharsets.UTF_8));
    }
Generates a random nonce value for Content Security Policy.
Creates a UUID, converts it to a string, gets its bytes in UTF-8 encoding,
and encodes those bytes as a Base64 string.

@return Base64 encoded nonce string
primefaces/src/main/java/org/primefaces/csp/CspState.java