This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
The moose likes Performance and the fly likes how to generate a unique number from a series of numbers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Performance
Reply locked New topic
Author

how to generate a unique number from a series of numbers

sai srinivas jonnalagadda
Greenhorn

Joined: Jul 27, 2011
Posts: 9
Hi,
I am developing a application, which has some int manipulations.
Thing is i am getting input values as 31958379002001000, 31958379002001000, 31898379002001000, 31828379002002000, 31828379002002000 etc.
they are not fit in int. but i must use int only.

so, I want to generate a distinct unique number for each of the big input number shown above and display them in response in some how. and the resultant number should again be fit in int size.

I need it very urgent. please help me.

Thanks
Amol Sonawane
Greenhorn

Joined: Sep 29, 2007
Posts: 2
You can use
long number = 31958379002001000L;
int i = (int)(number ^ number >>> 32);
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to generate a unique number from a series of numbers