[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:5973](https://github.com/evoluhq/evolu/blob/037c390af081e9944d616ff298a729515c5c5ab7/packages/common/src/Type.ts#L5973)

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<Id & Brand<"Todo">, typeof todoId>();
```