How to generate 8 bytes unique random number in python?
问题 Is there any way to generate a unique random number that has 8 bytes size in python language? I used the UUID library but it has 16 bytes which are not aligned with my requirement. Any help would be much appreciated. Thanks in advance 回答1: Well, you could use Linear Congruential Generator which, with proper selection of parameters, produce perfect mapping from u64 to u64. In other words, if you have access to previous 8bytes UUID, you could generate reasonable random next 8bytes UUID WITHOUT