File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Help needed to generate token Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply 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
Bartender

Joined: Aug 16, 2005
Posts: 12929
    
    3

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: 19216

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


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Help needed to generate token
 
Similar Threads
compund key algorithm for hashmap
generating security tokens in servlets
How to parse a string with "|" and empty strings
How to create ConfirmServlet using a JavaMail / Servlet Mechanism?
Algorithm to generate random token ids.