LOG IN SIGN UP
Documentation

randomint_seeded()

Identical to randomint, except takes an additional parameter used to seed the random number generator.

This does not use secure random numbers and should not be used for cryptographic purposes.

This function is not prefixed with the std. namespace.

Format

INTEGER
randomint_seeded(INTEGER from, INTEGER to, INTEGER seed)

Examples

1
2
3
4
5
6
7
8
9
10
if (randomint_seeded(1, 5, user_id) < 5) {
  set req.http.X-ABTest = "A";
} else {
  set req.http.X-ABTest = "B";
}
if (randomint_seeded(-1, 0, 555) == -1) {
  set req.http.X-ABTest = "A";
} else {
  set req.http.X-ABTest = "B";
}