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
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.
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
True, I would just use the built-in secrets module
Send once every minute for the starting seed for psudo random.
@@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
The module is good and built-in, so why take unnecessary effort to get a random number from the Internet? 🙃
What about /dev/random ? Can it be used to generate true random numbers? Or are they pseudo-random?
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).
what the deffrences between random and that the both give us random number ? and thank you , you are the best
what about secrets or os.urandom? Http requests are too slow.
I found this useful! Thanks!!!
Excellent as always
What IDE is that?
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
no such thing as true entropy, only the illusion of such due to scale of observation
Universe is big enough to make it truly random
thanks bro
👍Thanks.
wssup sneako