Creating a top-hat distributed random number generator

enter image description here

I have this Fortran code which generates a flat distribution as it produces a single random number centered on 0. The function GRNDM (Geant 4 random number generator) produces equally distributed random numbers between the values of 0 and 1. RDUMMY is the name of the vector filled with the random number and the argument “1” states the length of the vector: i.e. GRNDM here will produce a single random number between 0 and 1. The second line then produces random numbers in the interval [μ−σ2,μ+σ2].

I was wondering if there was a way of changing it to produce random numbers with a top hat distribution?

Why high and lower bit of generator must be 1?

Here is an excerpt from Andrew S. Tanenbaum, Computer Networks, 5th edition, Chapter 3 (The data link layer), Page 213:

enter image description here

[Both the high and low order bit of the generator must be 1.]

My question is how do you determine high order bit? And why high order bit and lower order bit, both must be one? From my understanding, it is used to detect burst error but is my understanding true?

how to send prime and generator of diffie hell-men to client over network node js?

I am using crypto module of node js for exchanging key using diffie-hellman algorithm.


const crypto = require("crypto");  const alice = crypto.createDiffieHellman(512);  const aliceKey = alice.generateKeys(); 


const bob = crypto.createDiffieHellman(alice.getPrime(), alice.getGenerator());  const bobKey = bob.generateKeys();  const aliceSecret = alice.computeSecret(bobKey);  const bobSecret = bob.computeSecret(aliceKey); 

The above example is taken from node.js documentation as shown the client uses servers prime number for generating the prime number.

my question is how should I securely send the prime number and the other parameter to client over internet? are there any other alternatives?

and another question is that I am generating keys using generate keys function but I have already generated private-key.pem and public-cert.pem file. can I use those if yes then how?, if no then what is difference between those keys?

Is it better for me to bang on the keyboard for 12 characters or use my password manager’s generator?

I use a password manager with a long rememberable master password for logging into all of my online accounts. When signing up for new accounts my password manager prompts me to generate a strong password which it then autofills. This auto generated password is a twelve character long alphanumeric string. Is there higher risk in me attempting to generate a random password by randomly pressing twelve characters on on the keyboard vs a potential flaw in the generator that would allow password discovery with some other available information (password creation time, password length, creation method)?

I know in the ideal case the password generator is far superior to my attempt to be random on the keyboard, but is my hand dropping on the keyboard so much worse that the risk of my password manager’s generator being flawed is the better of the two options? I know this might be an opinionated question so any facts, studies, or personal knowledge on this topic would be highly appreciated. I did attempt to Google this question and my searches along the lines of “password generator vs random typing” yielded no good results.

PS: Where as I don’t use them it might be cool if answers also addressed random typing vs going to Google, searching “password generator”, clicking one of the top results, and then using a web based random password generator.

How likely is for a pseudorandom number generator to generate a long sequence of similar numbers?

How likely is for a pseudorandom number generator to generate a long sequence of similar numbers? “Similar numbers” could be same numbers, or numbers from a given range.

For example, if we consider PRNG algorithm being a simple counter counting from 0 tom MAX, the distribution is uniform and there’s a guarantee of not repeating numbers in a sequence. So, not repeating numbers does not break uniformness. But probably it breaks randomness, does it? To what extent? If so, does it mean, that the better the algorithm, the less guarantee we have to not generate similar numbers in sequence?

I’m particularly interested in the answers regarding Mersenne Twister as a most popular PRNG in programming languages implementations. It’d also be great to know how things are in operating systems’ crypto-secure PRNGs – Yarrow (macOS), Fortuna (FreeBSD) or ChaCha20 (Linux).

How to combine GSA Content Generator + GSA SER

I want to correctly build links to my money website without a penalty from Google.
I realized that for this I should first place a link to a page from a web 2.0 resource, and then massively link to this page from other sources, the text on the web 2.0 page must be relevant to link that is placed on this page.
I want to use the GSA Content Generator for relevant text. How can I do it?
How post 1000 relevant to link pages automatically with GSA Content Generator???

I spent the whole day to solve this problem. I watched a lot of videos, I could not find an answer. Help me please

Does a generator really stops the execution at the machine code level, and does it not use the stack?

Never have I heard of a partially executed function before. But it seems the idea of it has been out for some time. Does a generator really stop execution at the machine code level, and that next time when the iterator is invoked, then there is a jump back to that machine code location to continue the execution?

It seems quite strange, as

  1. it differ from mathmatics for what a function is.
  2. the traditional function will add to the stack, and once finished, everything is popped from the stack. But the generator is like a function that stays… so nothing is popped from the stack. So does it use something other than the stack for memory?

Example: JavaScript ES6 Generator:

function* generator() {     yield 1;     yield 3;     yield 5; }  const iterator = generator();  console.log(; console.log(; console.log(; console.log(; 


{value: 1, done: false} {value: 3, done: false} {value: 5, done: false} {value: undefined, done: true} 

using HW random number generator as source of entropy

Currently I am using haveged on my server as source of entropy.

My Server is used as KVM hypervisor, to run virtual machines.

I did not use haveged at the beginning, and I noticed the VMs were draining the entropy pool from the server. Sometimes, when VMs were started SSH waited for enough entropy (to generate session keys, I guess).

Now with haveged, I don’t have this problem anymore.

But I would like to try to use a HW random number generator. I am not saying haveged is bad, but true HW random number generator can only make the entropy better. I have seen some HW RNG which work on basis of Geiger counter, some which collect noise from microphone, and so on.

Which are most reasonable to use ? Could somebody perhaps recommend some specific one ?

Ideally, I would like it to be connected over serial port. Second best would be over USB.