Another random number helper function; unit tests