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

```
BOOL randombool_seeded(INTEGER numerator, INTEGER denominator, INTEGER seed)
```

**Available in:** all subroutines

Identical to `randombool()`, except takes an
additional parameter, which is 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.

## Example

```vcl
set req.http.my-hmac = digest.hmac_sha256("sekrit", req.http.X-Token);
set req.http.hmac-chopped = regsub(req.http.my-hmac, "^(..........).*$","\1");
if (randombool_seeded(5,100,std.strtol(req.http.hmac-chopped ,16))) {
  set req.http.X-Allowed = "true";
} else {
  set req.http.X-Allowed = "false";
}
```
