I have maximum number of bits that is not bit aligned E.g. 35 and required to generate unique random number from 1 - 68719476734 (max number for 35 bits). Could use SecureRandom but will have to extract 5 bytes out of it and convert to Long maybe, but chances of collision seem to a concern. What are some options to generate a random for this range. Could i seed this random with nanoTime maybe if there is a collision and regenerate in this range.
Aucun commentaire:
Enregistrer un commentaire