random-number-generator

Better Random Generating PHP

I know that just using rand() is predictable, if you know what your doing, and have access to the server. I have a project that is HIGHLY dependent on choosing a random that is as unpredictable as possible. So I'm looking for suggestions, either other built in functions, or user functions that can generate a 'better' random number. I us...

How do I generate a random 10 digit number in ruby?

Additionally, how can I format it as a string padded with zeros? ...

True random number generator

Sorry for this not being a "real" question, but Sometime back i remember seeing a post here about randomizing a randomizer randomly to generate truly random numbers, not just pseudo random. I dont see it if i search for it. Does anybody know about that article? ...

How do you generate a random number in C#?

I would like to generate a random floating point number between 2 values. What is the best way to do this in C#? ...

How to test randomness (case in point - Shuffling)

First off, this question is ripped out from this question. I did it because I think this part is bigger than a sub-part of a longer question. If it offends, please pardon me. Assume that you have a algorithm that generates randomness. Now how do you test it? Or to be more direct - Assume you have an algorithm that shuffles a deck of car...

equivalent vb code for a java code

Can anyone tell me what exactly does thi java code do? SecureRandom random = SecureRandom.getInstance("SHA1PRNG"); byte[] bytes = new byte[20]; synchronized (random) { random.nextBytes(bytes); } return Base64.encode(bytes); Step by step explanation will be useful so that I can recreate this code in VB. Thanks ...

Pseudo random generator, Assembler

Which "random" numbers generator algorithm is the best for an assembler program? Something easy, not a long piece of code. Not external library allowed, just trying to keep it simple. @Bill Barksdale: I'm looking for an easy algorithm to use in a assembler program assigned in a course. ...

How do I generate a list of n unique random numbers in Ruby?

This is what I have so far: myArray.map!{ rand(max) } Obviously, however, sometimes the numbers in the list are not unique. How can I make sure my list only contains unique numbers without having to create a bigger list from which I then just pick the n unique numbers? Edit: I'd really like to see this done w/o loop - if at all pos...

xsd to rnc (or rng) conversion (unix command line)

A brief search shows that all available (unix command line) tools that convert from xsd (XML Schema) to rng (RelaxNG) or rnc (compact RelaxNG) have problems of some sort. First, if I use rngconv: $ wget https://msv.dev.java.net/files/documents/61/31333/rngconv.20060319.zip $ unzip rngconv.20060319.zip $ cd rngconv-20060319/ $ java -jar...

Opensource Implementation of the Alias Method

I am doing a project at the moment, and in the interest of code reuse, I went looking for a library that can perform some probabilistic accept/reject of an item: i.e., there are three people (a, b c), and each of them have a probability P{i} of getting an item, where p{a} denotes the probability of a. These probabilities are calculated...

Could a truly random number be generated using pings to psuedo-randomly selected IP addresses?

The question posed came about during a 2nd Year Comp Science lecture while discussing the impossibility of generating numbers in a deterministic computational device. This was the only suggestion which didn't depend on non-commodity-class hardware. Subsequently nobody would put their reputation on the line to argue definitively for or ...

Generating Random Numbers in Objective-C

I'm a java head mainly, and I want a way to generate a pseudo-random number between 0 and 74. In java I would use the method: Random.nextInt(74) I'm not interested in a discussion about seeds or true randomness, just how you accomplish the same task in Objective-C. I've scoured The Google, and it just seems to be lots of different and...

Fast pseudo random number generator for procedural content

I am looking for a pseudo random number generator which would be specialized to work fast when it is given a seed before generating each number. Most generators I have seen so far assume you set seed once and then generate a long sequence of numbers. The only thing which looks somewhat similar to I have seen so far is Perlin Noise, but i...

Windows equivalent of /dev/random

Is there a Windows equivalent of Linux's /dev/random? ...

Do stateless random number generators exist?

Is there a difference between generating multiple numbers using a single random number generator (RNG) versus generating one number per generator and discarding it? Do both implementations generate numbers which are equally random? Is there a difference between the normal RNGs and the secure RNGs for this? I have a web application that ...

Generating unique codes in PHP/MySQL?

I'm working with a client that needs to generate millions of the alphanumeric codes used in magazine scratch-off cards, bottlecap prizes, and so on. They have to be short enough to print on a cap, they want to make sure that ambiguous characters like 1 and I, 0 and O, etc. are not included, and they have to be explicitly stored for futur...

Distributed Random Number Generation

I was wondering if there is a way for a network of N participants to agree that a number from 1 to M was chosen at random. (e.g. not influenced by any of the participants) This has been solved for values of n=2 and m=2 by the coin tossing protocol. Does anyone know of any solutions that can work for arbitrary values of N and M? ...

What is the impact of virtualisation on cryptographically strong random number generators?

/dev/random and /dev/urandom use environmental noise to generate randomness. With a virtualised server there can be multiple instances of an Operating System on one hardware configuration. These operating systems will all be sourcing their randomness from the same environmental noise. Does this mean as a group the random number genera...

Pseudo Random Generator with same output

I came across an article about Car remote entry system at http://auto.howstuffworks.com/remote-entry2.htm In the third bullet, author says, Both the transmitter and the receiver use the same pseudo-random number generator. When the transmitter sends a 40-bit code, it uses the pseudo-random number generator to pick a new code, which i...

Reliable real values generator for Excel for Office 2007 and Vista SP1

Dear all, can you please tell me which add-in you are using to generate real/integer values in Excel 2007 (running on Vista SP1)? I have tried a couple of them and particularly Random Generator from AbleBits.com but there are some problems with entering lowest and highest values there. I guess this is due to Office 2007 & Vista configu...