> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qu.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# scryptSync

```ts theme={null}
function scryptSync(
   _passwd, 
   _salt, 
   N, 
   r, 
   p, 
   dkLen): string
```

Provides a synchronous variant of [**scrypt**](/sdk/content/functions/scrypt).

This will completely lock up and freeze the UI in a browser and will prevent any event loop from progressing. For
this reason, it is preferred to use the [async variant](scrypt).

## Parameters

| Parameter | Type                                               | Description                        |
| :-------- | :------------------------------------------------- | :--------------------------------- |
| `_passwd` | [`BytesLike`](/sdk/content/type-aliases/BytesLike) | The password to use.               |
| `_salt`   | [`BytesLike`](/sdk/content/type-aliases/BytesLike) | The salt to use.                   |
| `N`       | `number`                                           | The CPU/memory cost parameter.     |
| `r`       | `number`                                           | The block size parameter.          |
| `p`       | `number`                                           | The parallelization parameter.     |
| `dkLen`   | `number`                                           | The length of the key to generate. |

## Returns

`string`

The key derived from the password.

## Example

```ts theme={null}
// The password must be converted to bytes, and it is generally
// best practices to ensure the string has been normalized. Many
// formats explicitly indicate the normalization form to use.
password = 'hello';
passwordBytes = toUtf8Bytes(password, 'NFKC');

salt = id('some-salt');

// Compute the scrypt
scryptSync(passwordBytes, salt, 1024, 8, 1, 16);
```

## Source

[crypto/scrypt.ts:153](https://github.com/dominant-strategies/quais.js/blob/c1c12d43f9d34c6baad2b0542bd6d0acd6fefcbf/src/crypto/scrypt.ts#L153)
