This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
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

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Help needed to generate token" Watch "Help needed to generate token" New topic

Help needed to generate token

Pradeep Kumar
Ranch Hand

Joined: Sep 08, 2006
Posts: 108
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,

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

Joined: Aug 16, 2005
Posts: 14996

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 8 API documentation
Rob Spoor

Joined: Oct 27, 2005
Posts: 20131

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

How To Ask Questions How To Answer Questions
I agree. Here's the link:
subject: Help needed to generate token
jQuery in Action, 3rd edition