jQuery in Action, 2nd edition*
The moose likes Beginning Java and the fly likes Help needed to generate token Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Help needed to generate token" Watch "Help needed to generate token" New topic
Author

Help needed to generate token

Pradeep Kumar
Ranch Hand

Joined: Sep 08, 2006
Posts: 108
Hi,
I have a requirement to generate a unique token which is of type String of Alphanumeric characters. The length of the string should always be 24. I am using MD5 algorith. Can you please tell me how to generate the unique token string.

Thanks and Regards,
Pradeep


Thanks and Regards, Pradeep Kumar
SCJP 1.6, SCWCD 5.0
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14104
    
  16

MD5 is an algorithm that creates hash codes, and does not have anything to do with generating unique tokens, and cannot be used for creating unique tokens. How are you trying to use MD5 for this?


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19670
    
  18

UUID is about the only API class that can generate truly unique numbers.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help needed to generate token