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

```ts
function createIdFromString<B>(
  value: string,
  ..._validation: IdBrandValidation<B>
): CreatedId<B>;
```

Defined in: [packages/common/src/Type.ts:7329](https://github.com/evoluhq/evolu/blob/dd96d79f1dbe9a49fa12ce8e0aa7d3d0177795ca/packages/common/src/Type.ts#L7329)

Deterministically creates an [Id](https://evolu.dev/docs/api-reference/common/Type/variables/Id) from the first 16 SHA-256 bytes.

Use this to map an external identifier consistently on every client. The
operation is not reversible; store the original identifier separately when it
must be retained.

### Example

```ts
import {
  assertEqual,
  assertType,
  createIdFromString,
  type Brand,
  type Id,
} from "@evolu/common";

const first = createIdFromString("external-user-123");
const second = createIdFromString("external-user-123");
const todoId = createIdFromString<"Todo">("external-todo-456");

assertEqual(first, second);
assertType<typeof todoId, Id & Brand<"Todo">>();
```