> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stellarium.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Uuid

> UUID functions in sh.stellarium.stdlib.Uuid.

```requestscript theme={null}
const uuid: sh.stellarium.stdlib.Uuid
```

## new

Generates a random version 4 UUID. Takes no parameters.

**value** `string`

A lowercase, hyphenated v4 UUID, such as `3b241101-e2bb-4255-8caf-4136c566a962`.

```requestscript theme={null}
request NewId {
  const uuid: sh.stellarium.stdlib.Uuid

  const id = uuid.new()

  if (id.error != null) {
    return id.error.message
  }

  return id.value
}
```

```json Response theme={null}
{ "returnValue": "3b241101-e2bb-4255-8caf-4136c566a962" }
```

UUIDs are generated with Node.js [`crypto.randomUUID()`](https://nodejs.org/api/crypto.html#cryptorandomuuidoptions), which uses a cryptographically secure random number generator. Each call returns a new value.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.