Get a buffer of random bytes from /dev/urandom (or another) file.
$ npm install randbytes
RandBytes is written on CoffeeScript, first you need install this with
npm install coffee-script
$ git clone$ cd node-randbytes$ coffee -c -o . src/
Reading from /dev/urandom (secure and faster):
var RandBytes = 'randbytes';var randomSource = RandBytesurandom;randomSource;
var RandBytes = ;RandBytes;
If you are not using a Unix like OS, you can generate random bytes from time:
var randomSource = RandBytestimeRandom;
var randomSource =filePath: '/home/you/walesongs.wav';
If you need a high randomize source, you can read from /dev/random, but is very slowly.