jverd wrote:Perfect! Thanks very much. I thought I might be reinventing the wheel.
You could use http://java.sun.com/javase/6/docs/api/java/util/UUID.html.
It's not "guaranteed" unique. Only unique with a ridiculously high probability. There's more likely a bug in your code or in the JVM that will break things than that you'll get a duplicate here.