[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [Type](https://evolu.dev/docs/api-reference/common/Type) › createId

```ts
function createId<B>(
  deps: RandomBytesDep,
  ..._validation: IdBrandValidation<B>
): CreatedId<B>;
```

Defined in: [packages/common/src/Type.ts:5939](https://github.com/evoluhq/evolu/blob/037c390af081e9944d616ff298a729515c5c5ab7/packages/common/src/Type.ts#L5939)

Creates a cryptographically random [Id](https://evolu.dev/docs/api-reference/common/Type/variables/Id).

This is the recommended default because it does not encode creation time.
Pass a Brand name when the returned Id belongs to one domain entity.

### Example

```ts
import {
  assertTrue,
  assertType,
  Id,
  createId,
  createRandomBytes,
  type Brand,
} from "@evolu/common";

const userId = createId<"User">({ randomBytes: createRandomBytes() });

assertTrue(Id.is(userId));
assertType<Id & Brand<"User">, typeof userId>();
```