> ## Documentation Index
> Fetch the complete documentation index at: https://resq-dependabot-github-actions-github-actions-478e18be3d.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# MaskPII

# Function: maskPII()

> **maskPII**(`data`): `string`

Defined in: [crypto.ts:198](https://github.com/resq-software/npm/blob/fe2e20ae9db8398a0db1e3218edaabb3cf7004d6/packages/security/src/crypto.ts#L198)

Mask an arbitrary PII string for safe logging — keeps the first two
and last two characters and replaces everything in between with
asterisks. Strings of length ≤ 4 are fully masked as `"****"`.

## Parameters

### data

`string`

Raw PII string.

## Returns

`string`

Masked representation safe for logs.

## Example

```ts theme={null}
maskPII("4242424242424242"); // → "42************42"
maskPII("AB12");              // → "****"
```
