question

Jørgen Havsberg Seland avatar image
Jørgen Havsberg Seland asked

How to obtain secure random numbers in cloud script

For a specific scenario we require secure random numbers in our cloud script implementation. Is this available in the PlayFab cloud scripts, or would we have to make an external HTTP request to obtain this?

CloudScript
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Seth Du avatar image
Seth Du answered

It depends on how will you generate this random number. Cloud Script is based on Google V8 Engine, which is running on native JavaScript and 3-rd party modules are not supported. You can generate random number simply via Math.random();

If Math.random() can’t meet your requirement, you can also make an external HTTP request to obtain this.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.