Skip to main content

.xmur3()

A function that takes a string and returns a function that creates a numerical value based on the xmur3 algorithm. The returned function can be called multiple times to produce multiple seeds. Intended to be used with JSF, LCG, mulberry32, sfc32, and xoshiro128ss.

Syntax

#fs.scripts.lib().xmur3(str);

Parameters

str

The string that will serve as the seed for RNG.

Return

Returns a function that generates numerical seeds.

Example

function(context, args) {
const l = #fs.scripts.lib();
const my_string = "i_am_a_string_to_be_hashed";
const seed = l.xmur3(my_string);

return seed();
}