What PRNG generator does Godot use?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Cameron Kilgore
:warning: Old Version Published before Godot 3 was released.

I am currently working on a project that involves random operations, and before I go further down the rabbit hole of building a custom RNG within GDScript (based on the Mersenne Twister algorithm), I would like to know what specific PRNG algorithm is used by the GDScript rand() functions, in the hopes that time spent building out MT can be better spent on other functionality. Thanks!

You can edit Godot if you want. There’s even the C code in the Wikipedia:
Mersenne Twister - Wikipedia

mateusak | 2017-01-04 15:28

:bust_in_silhouette: Reply From: Zylann

I thought it was the rand() C provides, however it turns out it is a different one:

The title says it’s a Xorshift31 PRNG.

Thanks for clarifying! Xorshift31 is more than sufficient enough for what my needs entail.

Cameron Kilgore | 2017-01-19 14:00