# newId

Canonical: https://docs.shumoku.dev/en/library/api/newId
Language: en

@shumoku/core · 0.4.0 · function

# newId

[Source](https://github.com/konoe-akitoshi/shumoku/blob/main/libs/@shumoku/core/src/ids.ts#L23)

Generate a fresh unique ID for the given entity kind. Collision probability for 10-char nanoid is negligible for editor-scale workloads (~trillions of IDs before 1% collision chance).

```
newId(kind: IdKind, size?: number): string
```

## Parameters

| Parameter | Type | Description | Default |
| --- | --- | --- | --- |
| `kind` | `IdKind` | No additional description. | `—` |
| `size` | `number` | No additional description. | `10` |

## Returns

```
string
```

[`libs/@shumoku/core/src/ids.ts:23`](https://github.com/konoe-akitoshi/shumoku/blob/main/libs/@shumoku/core/src/ids.ts#L23)
