Generating ACTUALLY Random Numbers in Python

Поділитися
Вставка
  • Опубліковано 5 вер 2024
  • Today we how to generate truly random numbers in Python.
    ◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
    📚 Programming Books & Merch 📚
    🐍 The Python Bible Book: www.neuralnine...
    💻 The Algorithm Bible Book: www.neuralnine...
    👕 Programming Merch: www.neuralnine...
    🌐 Social Media & Contact 🌐
    📱 Website: www.neuralnine...
    📷 Instagram: / neuralnine
    🐦 Twitter: / neuralnine
    🤵 LinkedIn: / neuralnine
    📁 GitHub: github.com/Neu...
    🎙 Discord: / discord

КОМЕНТАРІ • 19

  • @user-hj2ed5pe6j
    @user-hj2ed5pe6j Рік тому +12

    Col=5 is the number of columns to show the numbers in that website. It is unfortunately a mandatory parameter. I think in python we can use col=1 only, as it does not matter, especially for a single random number.

  • @oguzhantopaloglu9442
    @oguzhantopaloglu9442 Рік тому +12

    I mean its all good and all but why the fuck would I want to send a HTTP request to just generate a random number. This is going to be extremely slow in the long run :P

    • @aflous
      @aflous Рік тому +2

      True, I would just use the built-in secrets module

    • @Craxulator
      @Craxulator 6 місяців тому +1

      Send once every minute for the starting seed for psudo random.

    • @oguzhantopaloglu9442
      @oguzhantopaloglu9442 6 місяців тому

      @@Craxulator literally use any quality and slow PRNG to get a seed for another PRNG.
      Or literally use splitmix64 with the current time or smth

  • @krzysiekkrzysiek9059
    @krzysiekkrzysiek9059 Рік тому +5

    The module is good and built-in, so why take unnecessary effort to get a random number from the Internet? 🙃

  • @Antek1234l
    @Antek1234l Рік тому +5

    What about /dev/random ? Can it be used to generate true random numbers? Or are they pseudo-random?

  • @brucea9871
    @brucea9871 6 місяців тому

    This is a method I never heard of. I thought you would use a method similar to one I used on a computer I had many years ago. It had a pseudo random number generator and a way to get it to produce more truly random numbers was to seed it with the computer's timer. If I remember correctly the timer started at 0 and incremented once every 1/60 of a second until it reached 65535 and then started over at 0 (it was not PC compatible). So every time I ran a program needing random numbers the timer would almost certainly have a different value so the random number generator would produce a different series of random numbers. I thought you would use a similar method (seed the random number generator with the time of day for instance).

  • @kamelboudaoud-qh7od
    @kamelboudaoud-qh7od Рік тому +1

    what the deffrences between random and that the both give us random number ? and thank you , you are the best

  • @mertemr
    @mertemr Рік тому +2

    what about secrets or os.urandom? Http requests are too slow.

  • @jim9198
    @jim9198 Рік тому +1

    I found this useful! Thanks!!!

  • @pedroRaiden
    @pedroRaiden Рік тому +1

    Excellent as always

  • @septenaryshrub2587
    @septenaryshrub2587 10 місяців тому +1

    What IDE is that?

  • @SolathPrime
    @SolathPrime Рік тому +9

    Good Idea using an out rng to get a true random Number
    but I love my solution
    I made my own rng hardware, and embedded it in my computer mother board
    I don't say it's easy but it's efficient, and runs on 5volts, also it uses an ADC
    also it's copper wires that detects the change in magnetic field around it and sums all the differences
    if you google how to make one you'll find many solutions that works perfectly
    I made it for less than 50 EGP that's almost 1 usd

  • @IntegralTriangle
    @IntegralTriangle Рік тому +1

    no such thing as true entropy, only the illusion of such due to scale of observation

    • @InnerEagle
      @InnerEagle 8 місяців тому

      Universe is big enough to make it truly random

  • @natasha_huang
    @natasha_huang Рік тому +1

    thanks bro

  • @guilherme5094
    @guilherme5094 Рік тому +1

    👍Thanks.

  • @SixHundredAndSixtySix
    @SixHundredAndSixtySix Рік тому

    wssup sneako