org.pixel.commons.util.HashUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pixel-commons-linux Show documentation
Show all versions of pixel-commons-linux Show documentation
Java 2D Game Framework inspired on the popular XNA framework.
The newest version!
/*
* This software is available under Apache License
* Copyright (c) 2020
*/
package org.pixel.commons.util;
import java.util.concurrent.atomic.AtomicLong;
public class HashUtils {
//region private properties
private static final String UID_PREFIX = "px-";
private static final AtomicLong uid = new AtomicLong(0);
//endregion
//region public static methods
/**
* Generate a unique identification value
*
* @return
*/
public static String generateUID() {
return UID_PREFIX + uid.incrementAndGet();
}
/**
* Generate a numeric unique identification value
*
* @return
*/
public static long generateNumericUID() {
return uid.incrementAndGet();
}
//endregion
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy