Expensive but Reliable method


  • 0
    H

    Generating a random string for your tiny url can be very complex. This Java API is secure and reliable.

        private SecureRandom random = new SecureRandom();
            
        public String generateTinyCode() {
            return new BigInteger(32, random).toString(32);
        }
    
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.