Skip to main content

.sfc32()

A function that takes 4 seed parameters and returns a PRNG function based on the sfc32 algorithm.

Syntax​

#fs.scripts.lib().sfc32(a, b, c, d);

Parameters​

a​

First seed number.

b​

Second seed number.

c​

Third seed number.

d​

Fourth seed number.

Return​

Returns a number.

Example​

function(context, args) {
const l = #fs.scripts.lib();
const seed_1 = 3554674;
const seed_2 = 4865874;
const seed_3 = 4242356;
const seed_4 = 9674544;
const rng = l.sfc32(seed_1, seed_2, seed_3, seed_4);

return rng();
}