All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.undefinedlabs.scope.utils.RandomUtils Maven / Gradle / Ivy

package com.undefinedlabs.scope.utils;

import java.util.UUID;
import java.util.concurrent.ThreadLocalRandom;

public class RandomUtils {

  public static long uniqueId() {
    long val = 0;
    while (val == 0) {
      val = ThreadLocalRandom.current().nextLong(); // Since Java 1.7
    }

    return val;
  }

  public static String uuidV4() {
    return UUID.randomUUID().toString();
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy