This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
    Bookmark Topic Watch Topic
  • New Topic

how to generate a unique number from a series of numbers

 
sai srinivas jonnalagadda
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Report post to moderator
You can use
long number = 31958379002001000L;
int i = (int)(number ^ number >>> 32);
 
    Bookmark Topic Watch Topic
  • New Topic