GithubHelp home page GithubHelp logo

Random number generation about toxcore HOT 3 CLOSED

irungentoo avatar irungentoo commented on July 17, 2024
Random number generation

from toxcore.

Comments (3)

irungentoo avatar irungentoo commented on July 17, 2024

I'm sorry, for some reason I was under the mistaken assumption that random() produced better random numbers than the rand() function.

If you check the code however you will realize that the only place the random_int() function is used for crypto is for generating the nonces.

The key generation is left to NaCl or sodium.

This will however be fixed.

Thank you for looking over the code.

from toxcore.

benwaffle avatar benwaffle commented on July 17, 2024

Just seed both random() and rand() in general, and there should be no troubles.
On Jul 13, 2013, at 6:34 PM, irungentoo [email protected] wrote:

I'm sorry, for some reason I was under the mistaken assumption that random() produced better random numbers than the rand() function.

If you check the code however you will realize that the only place the random_int() function is used for crypto is for generating the nonces.

The key generation is left to NaCl or sodium.

This will however be fixed.

Thank you for looking over the code.


Reply to this email directly or view it on GitHub.

from toxcore.

gmorenz avatar gmorenz commented on July 17, 2024

Your impression of random() and rand() isn't completely mistaken, there are libraries that have them separate, and in those random() is usually better at generating properly distributed random numbers. I mostly mentioned that in case it mattered to someone debugging who expected certain random numbers or something, personally I would leave a comment in the code about it and then ignore the issue.

from toxcore.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.