public static String generateRandomCodeVerifier ( SecureRandom entropySource , int entropyBytes ) { byte [ ] randomBytes = new byte [ entropyBytes ] ; entropySource . nextBytes ( randomBytes ) ; return Base64 . getUrlEncoder ( ) . withoutPadding ( ) . encodeToString ( randomBytes ) ; }
Generates a random code verifier string using the provided entropy source and the specified number of bytes of entropy .