There is an API that can do this:
Basic Random Number Generation (CEERAN0) API
This API will generate a number between 0 and 1. (You can multiply the fraction to get the number of random digits you desire.) It is called with 2 parameters and returns a fraction between 0 and 1.
Details can be found here:
This was first published in April 2005