Package org.apache.cayenne.util
Class IDUtil
java.lang.Object
org.apache.cayenne.util.IDUtil
helper class to generate pseudo-GUID sequences.
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
appendFormattedByte
(Appendable buffer, byte byteValue) Prints a byte value to a StringBuffer as a double digit hex value.static byte[]
pseudoUniqueByteSequence
(int length) static final byte[]
static final byte[]
static byte[]
pseudoUniqueSecureByteSequence
(int length) static byte[]
-
Method Details
-
appendFormattedByte
Prints a byte value to a StringBuffer as a double digit hex value.- Since:
- 1.2 Since 3.0 signature has changed to take Appendable argument.
-
pseudoUniqueByteSequence
public static byte[] pseudoUniqueByteSequence(int length) - Parameters:
length
- the length of returned byte[]- Returns:
- A pseudo-unique byte array of the specified length. Length must be at least 16 bytes, or an exception is thrown.
- Since:
- 1.0.2
-
pseudoUniqueSecureByteSequence
public static byte[] pseudoUniqueSecureByteSequence(int length) -
pseudoUniqueByteSequence8
public static final byte[] pseudoUniqueByteSequence8() -
pseudoUniqueByteSequence16
public static final byte[] pseudoUniqueByteSequence16()- Returns:
- A pseudo unique 16-byte array.
-
pseudoUniqueSecureByteSequence16
public static byte[] pseudoUniqueSecureByteSequence16()- Returns:
- A pseudo unique digested 16-byte array.
-