Advertisement
Guest User

Untitled

a guest
May 26th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>lool</title>
  4.  
  5. <script language="javascript" type= "text/javascript">
  6.  
  7. function generoi()
  8.  
  9. public class PassPhrase {
  10.  
  11. public static final int MIN_LENGTH = 10;
  12. protected static java.util.Random r = new java.util.Random();
  13.  
  14. protected static char[] goodChar = { 'a', 'b', 'c', 'd', 'e', 'f', 'g',
  15. 'h', 'j', 'k', 'm', 'n', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
  16. 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K',
  17. 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
  18. '2', '3', '4', '5', '6', '7', '8', '9', '+', '-', '@', };
  19.  
  20. public static String getNext() {
  21. StringBuffer sb = new StringBuffer();
  22. for (int i = 0; i < MIN_LENGTH; i++) {
  23. sb.append(goodChar[r.nextInt(goodChar.length)]);
  24. }
  25. return sb.toString();
  26. }
  27.  
  28. public static void main(String[] argv) {
  29. for (int i = 0; i < 20; i++) {
  30. System.out.println(PassPhrase.getNext());
  31. }
  32. }
  33. }
  34.  
  35. </script>
  36. </head>
  37. <body>
  38. <form name ="lomake">
  39. <!-- käyttöliittymälomake-->
  40. <input type = "button" value ="generoi" onclick = "generoi()">
  41.  
  42. </form>
  43. </body>
  44. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement