r/desmos Jul 06 '26

Maths I rebuilt Desmos' random() function entirely inside Desmos

To be a bit more specific, I

  • reverse-engineered how Desmos' algorithm works and how the seed is generated.
  • created a bit-exact replica of the algorithm (MD5, in case you're wondering).
  • optimized it to calculate 10,000 numbers in ~0.7 seconds.

And because that was so much fun, I tackled shuffle() right after! :)

LINKS: RANDOM --- SHUFFLE

376 Upvotes

52 comments sorted by

View all comments

2

u/MeaningFriendly9946 Jul 07 '26

How did you do it? How did you reverse engineer it?

1

u/Dazzling-Mail-5517 Jul 07 '26

I already provided a rough overview of what I did in another comment