fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6. import java.util.Base64;
  7.  
  8. /* Name of the class has to be "Main" only if the class is public. */
  9. class Ideone
  10. {
  11. public static void main (String[] args) throws java.lang.Exception
  12. {
  13. // your code goes here
  14. Random random = new Random();
  15. byte[] byteArray = new byte[60];
  16. random.nextBytes(byteArray);
  17. for(byte b:byteArray)
  18. System.out.print(b);
  19. System.out.println("");
  20. System.out.println(byteArray);
  21. String s = Base64.getUrlEncoder().encodeToString(byteArray);
  22. System.out.println(s);
  23. }
  24. }
Success #stdin #stdout 0.06s 32484KB
stdin
Standard input is empty
stdout
31-21133386-1416108-6895-70-1795-49748468-469166742-577487102-6311250706387-52-97-67-444247-115-97-127-21-6113-706-59-98883-96-27-110-63-329581-18-124-16
[B@54bedef2
H_5xIVbyEGy8X7rvX89KVETSCRBDKsdKV2bBcDJGP1fMn73UKi-Nn4Hr-nG6BsWeWAOg5ZLB4F9R7oTw