File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
    Bookmark Topic Watch Topic
  • New Topic

how to generate a unique number from a series of numbers

 
sai srinivas jonnalagadda
Greenhorn
Posts: 9
  • 0
  • 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
  • 0
  • 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