Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>lool</title>
- <script language="javascript" type= "text/javascript">
- function generoi()
- public class PassPhrase {
- public static final int MIN_LENGTH = 10;
- protected static java.util.Random r = new java.util.Random();
- protected static char[] goodChar = { 'a', 'b', 'c', 'd', 'e', 'f', 'g',
- 'h', 'j', 'k', 'm', 'n', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
- 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K',
- 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
- '2', '3', '4', '5', '6', '7', '8', '9', '+', '-', '@', };
- public static String getNext() {
- StringBuffer sb = new StringBuffer();
- for (int i = 0; i < MIN_LENGTH; i++) {
- sb.append(goodChar[r.nextInt(goodChar.length)]);
- }
- return sb.toString();
- }
- public static void main(String[] argv) {
- for (int i = 0; i < 20; i++) {
- System.out.println(PassPhrase.getNext());
- }
- }
- }
- </script>
- </head>
- <body>
- <form name ="lomake">
- <!-- käyttöliittymälomake-->
- <input type = "button" value ="generoi" onclick = "generoi()">
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement