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
add secure random number generator as extension #32
Conversation
Would be good if @marcoconti83 or @raphaelrobert could check it for any deficiencies. |
Generated by |
I guess I missed the previous discussion but why can't we use |
@typfel although |
Basically to be on the safe side and use cryptographically safe random numbers. |
Ok |
Also, I'm not sure how to test this, is there something we can test? |
What are you going to use this function for? Where do you need a random UInt? |
@marcoconti83 when we obfuscate a text message, we use a random array index to replace each non-whitespace character with a random alphabetic character |
Diff with previous: 18.1.1...18.2.0 Commits: b356ffc Merge pull request #32 from wireapp/feature/secure+random+integer 17e6734 add tests 4ecd036 guard against division by zero 1eb9b70 use overflow operator 9ce8dfd add secure random number generator as extension a6155c0 Merge pull request #31 from wireapp/feature/circleci 300baed Fix test results directory 0fffe38 Update config f03a108 Added CircleCI 2.0 config
What's in this PR?
I've added an extension to
UInt
to provide a secure random number generator with an upper bound and no modulo bias. This was suggested by @vytis and I've used this page as a guide.