Skip to content

Conversation

kateinoigakukun
Copy link
Member

@kateinoigakukun kateinoigakukun commented Apr 26, 2024

This protocol allows to inject a custom random number generator for wasi_snapshot_preview1::random_get function. The default implementation continues to use swift_stdlib_random function but users can provide their own implementation. Additionally, types conforming to RandomNumberGenerator can automatically conform to the new protocol.

This is useful when we want fully deterministic behavior like build tools or tests.

Resolves a part of #84

This protocol allows to inject a custom random number generator for
`wasi_snapshot_preview1::random_get` function. The default implementation
continues to use `swift_stdlib_random` function but users can provide
their own implementation. Additionally, types conforming to
`RandomNumberGenerator` can automatically conform to the new protocol.

This is useful when we want fully deterministic behavior like build
tools or tests.
@kateinoigakukun kateinoigakukun merged commit 949ff74 into main Apr 26, 2024
@kateinoigakukun kateinoigakukun deleted the katei/buffer-generator-protocol branch April 26, 2024 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant