How do you generate UUID of type long (64 bits - to be consumed by a java program) using Python?
I read about the UUID module. So I played with it a bit:
>>> import uuid
>>> uuid.uuid1().int
315596929882403038588122750660996915734L
Why is there an "L" at the end of the integer generated by uuid.uuid1().int? If it's an integer shouldn't it be made up of pure numbers?
Also according to the documentation uuid.uuid1().int will generate a 128 bits integer. I need an integer of type long (for a java program), that would mean it need to be 64 bits. Is it possible to generate a UUID of 64 bits instead of 128 bits?
Another problem is that according to the Python doc a Python int is 32 bits while a Python long has "unlimited precision." What does "unlimited precision" mean? I need a 64 bits long int - what Python type would that be?
EDIT: Thanks for everyone's replies. Looks like UUID's are by definition 128 bits. In that case I probably shouldn't be using the term UUID. What I want to do is to generate a unique ID that is of type long (64 bits). I thought UUID would do the job, but it looks like it can't.
I need that ID as the document ID for Solr search engine. I'm using a real-time indexing Solr plugin Zoie. And according to the documentation, "Zoie assumes every record to be indexed must have a unique key and of type long."
So given that's what I need, do you know what I can do to generate unique ID of type long?
Thank you!