[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) › createIdAsUuidv7

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

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

Creates an [Id](https://evolu.dev/docs/api-reference/common/Type/variables/Id) whose bytes use the UUID v7 timestamp layout.

The timestamp can improve insertion locality for very large write-heavy
indexes, but it exposes creation time anywhere the Id is copied, including
logs, URLs, and exports. Prefer [createId](https://evolu.dev/docs/api-reference/common/Type/functions/createId) unless that tradeoff is
deliberate.

### Example

```ts
import {
  assertEqual,
  createIdAsUuidv7,
  createRandomBytes,
  createTime,
  idToIdBytes,
} from "@evolu/common";

const value = createIdAsUuidv7({
  randomBytes: createRandomBytes(),
  time: createTime(),
});
const bytes = idToIdBytes(value);

assertEqual(bytes[6] >> 4, 0x7);
assertEqual(bytes[8] & 0xc0, 0x80);
```