Allow to specify a custom random number generator