LOG IN SIGN UP
Documentation

randomint()

Returns a random integer value between from and to, inclusive.

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

Format

BOOL
randomint(INTEGER from, INTEGER to)

Examples

if (randomint(0, 99) < 5) {
  set req.http.X-ABTest = "A";
} else {
  set req.http.X-ABTest = "B";
}
if (randomint(-1, 0) == -1) {
  set req.http.X-ABTest = "A";
} else {
  set req.http.X-ABTest = "B";
}