public final class RandomBasedFactory extends AbstRandomBasedFactory
| 限定符和类型 | 类和说明 |
|---|---|
static class |
RandomBasedFactory.Builder
Concrete builder for creating a random-based factory.
|
| 构造器和说明 |
|---|
RandomBasedFactory() |
RandomBasedFactory(java.util.function.IntFunction<byte[]> randomFunction) |
RandomBasedFactory(java.util.function.LongSupplier randomSupplier) |
RandomBasedFactory(Random random) |
| 限定符和类型 | 方法和说明 |
|---|---|
static RandomBasedFactory.Builder |
builder()
Returns a builder of random-based factory.
|
UUID |
create()
Returns a random-based UUID.
|
getVersionpublic RandomBasedFactory()
public RandomBasedFactory(Random random)
public RandomBasedFactory(java.util.function.LongSupplier randomSupplier)
public RandomBasedFactory(java.util.function.IntFunction<byte[]> randomFunction)
public static RandomBasedFactory.Builder builder()
public UUID create()
### RFC-4122 - 4.4. Algorithms for Creating a UUID from Truly Random or Pseudo-Random Numbers
(1) Set the two most significant bits (bits 6 and 7) of the clock_seq_hi_and_reserved to zero and one, respectively.
(2) Set the four most significant bits (bits 12 through 15) of the time_hi_and_version field to the 4-bit version number from Section 4.1.3.
(3) Set all the other bits to randomly (or pseudo-randomly) chosen values.
Copyright © 2024. All rights reserved.