---
title: uuid.version4
summary: null
url: >-
  https://www.fastly.com/documentation/reference/vcl/functions/uuid/uuid-version4
---

```
STRING uuid.version4()
```

**Available in:** all subroutines

A version 4 UUID is a randomly generated 128-bit identifier. As in other UUIDs, 4 bits are used to indicate version 4, and 2 bits are used to indicate the variant. Thus, 6 bits are constant, leaving 122 bits for the randomly generated part, for a total of 2<sup>122</sup> (5.3×10<sup>36</sup>, 5.3 undecillion) possible values.

## Example

```vcl
set req.http.X-Unique-Id = uuid.version4();
```
