code: function(max) {
  	// gives a number between 0 (inclusive) and max (exclusive)
  	var rand = crypto.randomBytes(1)[0];
  	while (rand >= 256 - (256 % max)) {
  		rand = crypto.randomBytes(1)[0];
  	}
  	return rand % max;
  }
docs: Generates a random number