I want to create a random alpha-numeric string whose bit count will always be of size k. The size k will be something relatively big (varying from 128 to 2048 or more). I'm reading this excellent thread and I'm trying to figure something out using the Random
and the SecureRandom
class but to no avail.
To be more precise, the result doesn't have to be necessarily a string, it could be anything as long as it is random and its bit count is always k.