How do you generate a secure random (or pseudo-random) alphanumeric string in Java efficiently?
If you use Apache Commons Lang, the easiest way is
RandomStringUtils.random(20, 0, 0, true, true, null, new SecureRandom());