-
Notifications
You must be signed in to change notification settings - Fork 35
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
Remove size limit for WASI random_get #508
Conversation
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.
A couple of notes but lgtm, having a test would be ideal but not a requirement at this stage.
Thanks!
if (Thread.currentThread().isInterrupted()) { | ||
throw new ChicoryException("Thread interrupted"); | ||
} | ||
new SecureRandom().nextBytes(data); |
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 think that SecureRandom
should be instantiated outside the loop.
It would be ideal to add a "Random source" to the WasiOptions
class, I can follow up with the changes.
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.
Good idea! I'll add another commit.
@andreaTP I updated |
I checked |
|
||
@Test | ||
public void wasiRandom() { | ||
var seed = 0x12345678; |
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.
perfect 👍
No description provided.