---
title: randomint_seeded
summary: null
url: >-
  https://www.fastly.com/documentation/reference/vcl/functions/randomness/randomint-seeded
---

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

**Available in:** all subroutines

Identical to `randomint()`, except takes an
additional parameter used to seed the random number generator. This seed determines randomness. A consistent seed will provide a consistent result.

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

Even though integer values in VCL are typically 64-bit signed integers,
this VCL function only accepts `from`, `to`, and `seed`, which are signed 32-bit integers.
The range of valid values for `from`, `to`, and `seed` is therefore
−(2<sup>31</sup>) to 2<sup>31</sup> − 1 inclusive.
That is, the minimum and maximum values are -2147483648 and 2147483647
respectively, or -0x80000000 and 0x7FFFFFFF in hexadecimal.

This function is not prefixed with the `std.` namespace.

## Example

```vcl
if (randomint_seeded(0, 99, 555) < 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";
}
```
