-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce deterministic random #178
Conversation
fd9ad35
to
332895f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good @slinkydeveloper!
private final Syscalls syscalls; | ||
private boolean seedInitialized = false; | ||
|
||
RestateRandom(long randomSeed, Syscalls syscalls) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Should this be just BooleanSupplier
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer to use Syscalls here, it makes a bit more clear this code.
Fix #155.
Please note that because the JDK
UUID
class doesn't have a way to specify a seed to its internal RNG, we can't use thisRandom
instance to generate uuids. Perhaps we can re-iterate on this later by adding a method ourselves?