# GetNextKey()

> Returns the next distributed unique id.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Localization](/engine/6000.7/script-reference/unity/localization.md)
* **Assembly:** UnityEngine.LocalizationRuntimeModule

```csharp
public long GetNextKey()
```

### Returns

| Type                                                        | Description                                       |
| ----------------------------------------------------------- | ------------------------------------------------- |
| [long](https://learn.microsoft.com/dotnet/api/system.int64) | A distributed unique id suitable for a table key. |

### Remarks

Combines the current timestamp, the [DistributedUIDGenerator.MachineId](/engine/6000.7/script-reference/unity/localization/distributeduidgenerator/machineid.md), and a per-millisecond sequence. The sequence keeps ids unique and increasing even when the clock moves backwards or several ids are requested within the same millisecond.

Generate a single id.

### Examples

```csharp
using Unity.Localization;
using UnityEngine;

namespace Unity.Localization.Samples
{
    public class DistributedUIDGeneratorGetNextKeyExample
    {
        public void Run()
        {
            var generator = new DistributedUIDGenerator();

            long id = generator.GetNextKey();

            Debug.Log(id);   // a distributed unique id
        }
    }
}
```
