Constructor and Description |
---|
UUIDUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
main(String[] args) |
static String |
newID()
Returns a 8 character string suitable for tracking, affiliate, short codes, etc.
|
static String |
newID(int len)
Returns a N-char string suitable for tracking, affiliate, short codes, etc.
|
static String |
newSessionID()
Returns a ID suitable for a session/cookie identifier.
|
public UUIDUtil()
public static String newSessionID()
See: cookies.lcs.mit.edu See: www.across.si There are 2 issues with generating sessionid's. 1) uniqueness - 2 or more sessionid's should not end up being the same. 2) hard-to-guess - For example, sequential values like 1, 2, 3 are unique but easy to guess and therefore easy to session hijack. Our sessionid's have 2 parts: a) a timestamp for guaranteed uniqueness (easy to guess) b) random data (hard to guess)
public static String newID(int len)
len
- the length of the returned stringpublic static String newID()