Update README.md
This commit is contained in:
parent
1cc8ed180e
commit
4b24b03f8f
|
@ -225,9 +225,9 @@ Use a `UlidFactory` with `ThreadLocalRandom` inside of a `Supplier<byte[]>`:
|
||||||
```java
|
```java
|
||||||
// use a random supplier that returns an array of 10 bytes
|
// use a random supplier that returns an array of 10 bytes
|
||||||
UlidFactory factory = UlidFactory.newInstance(() -> {
|
UlidFactory factory = UlidFactory.newInstance(() -> {
|
||||||
final byte[] bytes = new byte[Ulid.RANDOM_BYTES];
|
final byte[] bytes = new byte[Ulid.RANDOM_BYTES];
|
||||||
ThreadLocalRandom.current().nextBytes(bytes);
|
ThreadLocalRandom.current().nextBytes(bytes);
|
||||||
return bytes;
|
return bytes;
|
||||||
});
|
});
|
||||||
|
|
||||||
// use the factory
|
// use the factory
|
||||||
|
|
Loading…
Reference in New Issue