Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sufficient Suffixes
private static int counter = 0;
private static synchronized java.lang.String getUniqueSuffix() {
// reset the counter if it is greater than 99999
if (counter > 99999) {
counter = 0;
}
counter = counter + 1;
return java.lang.Long.toString(java.lang.System.currentTimeMillis()) + "_" + counter;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment