f4b6a3 / tsid-creator

A Java library for generating Time-Sorted Unique Identifiers (TSID).
MIT License
475 stars 50 forks source link

Add support for RandomGenerator in Java 17 #15

Closed fabiolimace closed 2 years ago

fabiolimace commented 2 years ago

Now it is easy to use RandomGenerator (JDK17) and SplittableRandom (JDK8).

Example:

// use a random function that returns an int value
RandomGenerator random = RandomGenerator.getDefault();
TsidFactory factory = TsidFactory.builder().withRandomFunction(() -> random.nextInt()).build();
fabiolimace commented 2 years ago

Released v5.0.0.