hash un-numeric input when used as PRNG seed, fixes #800 #801
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #800
As discussed on Slack, but there may be more to discuss!
What has been done to verify that this works as intended?
Ran the tests, added some tests too. Ideally I'd put this JR version in an ODKCollect to witness some choice randomization change when altering the seed value in this test form, but I didn't manage that today ;-)
Why is this the best possible solution? Were any other approaches considered?
The nice thing is that it doesn't change existing randomizations that were working well (eg, strings interpretable as numerics). It only changes randomizations for which the seed wasn't working (eg, strings not interpretable as numerics).
How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?
In very specific use cases this can cause an unwelcome change.
For instance: In some survey the randomization of the order of choice fields is part of the survey. Also, it wasn't actually working due to issue #800, but anyway. Now if ODKCollect is updated with this new OpenRosa version halfway through the survey, some users will have seen randomization X for seed Z while others will have seen randomization Y for that same seed Z. If the research draws conclusions based on either X or Y, then the researchers need to know which version of ODKCollect was used so they know (or can deduce) which choice randomization went with seed Z.
Do we need any specific form for testing your changes? If so, please attach one.
as mentioned above, running ODKCollect on this form and witnessing the choice list reshuffle based on string input variations in the seed field, would be extra convincing.
Does this change require updates to documentation? If so, please file an issue here and include the link below.
Maybe. We could say something like: