Haslo.java

Java RMI

import java.util.Random;

public class Haslo {
// NUM_CHARS znakowe hasło
private static final int NUM_CHARS = 2;

private static String chars = 
	"abcdefghijklmonpqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";

private static Random r = new Random();

public static String getUniqueID() {
	char[] buf = new char[NUM_CHARS];
	
	for (int i = 0; i < buf.length; i++) {
		buf[i] = chars.charAt(r.nextInt(chars.length()));
	}
	return new String(buf);
}
}

2012.11.22 22:29:13.