I need to generate unique 64 bits integers from Python. I’ve checked out the UUID module. But the UUID it generates are 128 bits integers. So that wouldn’t work.
Do you know of any way to generate 64 bits unique integers within Python? Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
just mask the 128bit int
These are more or less random, so you have a tiny chance of a collision
Perhaps the first 64 bits of uuid1 is safer to use
These are largely based on the clock, so much less random but the uniqueness is better