# Module /uuid

RFC 9562 UUIDv4 (random) and UUIDv7 (time-ordered) generation and validation.

```tangu
(use /uuid)
```

## Functions & symbols

### UUIDv4/str

`(UUIDv4/str) -> String`

Canonical constructor returning a random UUIDv4 string.

```tangu
(uuid/UUIDv4/str)
```

### UUIDv7/str

`(UUIDv7/str) -> String`

Canonical constructor returning a time-ordered UUIDv7 string.

```tangu
(uuid/UUIDv7/str)
```

### construct-v4-str

`(construct-v4-str) -> String`

Generates a random RFC 9562 UUIDv4 string (`8-4-4-4-12` lowercase hex).

```tangu
(uuid/construct-v4-str)
```

### construct-v7-str

`(construct-v7-str) -> String`

Generates a time-ordered RFC 9562 UUIDv7 string ideal for sortable database primary keys.

```tangu
(uuid/construct-v7-str)
```

### is-valid?

`(is-valid? value) -> Bool`

Returns `true` if `value` is a syntactically valid UUID string.

| Parameter | Type | Optional | Description |
| :--- | :--- | :--- | :--- |
| `value` | `String` | no | UUID string to validate |

```tangu
(uuid/is-valid? "550e8400-e29b-41d4-a716-446655440000")
```

### make-v4-uuid

`(make-v4-uuid) -> String`

Generates a random RFC 9562 UUIDv4 formatted as a lowercase hyphenated string.

```tangu
(uuid/make-v4-uuid)
```
