|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfc.util.UUIDUtil
public final class UUIDUtil
Constructor Summary | |
---|---|
UUIDUtil()
|
Method Summary | |
---|---|
static void |
main(java.lang.String[] args)
|
static java.lang.String |
newID()
Returns a 8 character string suitable for tracking, affiliate, short codes, etc. |
static java.lang.String |
newID(int len)
Returns a N-char string suitable for tracking, affiliate, short codes, etc. |
static java.lang.String |
newSessionID()
Returns a ID suitable for a session/cookie identifier. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UUIDUtil()
Method Detail |
---|
public static java.lang.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 java.lang.String newID(int len)
len
- the length of the returned stringpublic static java.lang.String newID()
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |