Skip to content
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 function for unbiased random numbers #309

Merged
merged 1 commit into from
Feb 4, 2019
Merged

Add function for unbiased random numbers #309

merged 1 commit into from
Feb 4, 2019

Conversation

kurnevsky
Copy link
Member

Later it will be used to choose random nodes for onion paths

@coveralls
Copy link

coveralls commented Jan 31, 2019

Pull Request Test Coverage Report for Build 1984

  • 13 of 14 (92.86%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.004%) to 96.205%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/toxcore/crypto_core.rs 11 12 91.67%
Totals Coverage Status
Change from base Build 1981: -0.004%
Covered Lines: 13537
Relevant Lines: 14071

💛 - Coveralls

@kpp
Copy link
Member

kpp commented Jan 31, 2019

@kurnevsky
Copy link
Member Author

kurnevsky commented Jan 31, 2019

@kpp they do the same but with multiplication instead of modulo. Honestly, I don't know why. Perhaps it's more performant even though much more complex. In terms of correctness my version should be fine. Alternatively we can use rand crate instead of libsodium but I'd left it for the future.

@kurnevsky
Copy link
Member Author

@kpp right, it's because of performance: rust-random/rand#570 (comment)

@kpp
Copy link
Member

kpp commented Feb 4, 2019

rebase

@kpp kpp merged commit 6ceedd7 into master Feb 4, 2019
@kpp kpp deleted the unbiased_random branch February 4, 2019 15:40
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.

3 participants