Skip to content

Conversation

@TimWolla
Copy link
Member

As promised in #13350 (comment):

As a possible follow-up, I plan to remove the seed member from the struct php_random_algo and instead add well-typed engine specific seed functions, because seeding an engine generically does not appear super useful to me (Mt19937 ignores the upper half of the uint64_t seed for example).

This avoids the function pointer indirection and improves type safety.
Different engines work quite differently, it is not useful to attempt to seed them in a generic way using a 64 bit integer. As an example Mt19937 completely ignores the upper 32 bits.
See the explanation in the previous commit for the reasoning. This member is unused since the previous commit and was not consistently available even before that (specifically for the Secure engine).
Copy link
Member

@ndossche ndossche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks good to me.
The macOS failure and Linux NTS failure are unrelated to this PR.

@TimWolla TimWolla merged commit 99e7cf0 into php:master Feb 29, 2024
@TimWolla TimWolla deleted the random-seed-api branch May 23, 2024 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

4 participants