Is there a way to set the seed for the random number generator in Apex? And if so; which function do I use for it?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It likely isn’t possible to seed the RNG in Apex. If you need a repeatable sequence of random numbers, you’ll have to implement a seeded pseudo random number generator yourself.
On the Apex platform, I’m sure they have a huge source of entropy available to generate random numbers, and there’s no need for you to seed the generator.