Secure random numbers in Realm functions

I am in the process of creating a email verification function for a Realm application where I would like to generate a random code to be directly sent to the user via an email api.

As this code is used to reset the user’s password I would like to know if the engine has a cryptographically secure random number generator. I could not find any documentation on this though I would have thought that the utils.crypto package would contain one.

For now I am simply using Math.random with a narrow limit on attempts. I am also happy to hear about other ways I could implement an email verification function if there is a more intelligent design, security is not my strongest area.