random number generation checking function impl-d