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

# util.hmac()

> Public low-code contract, signatures and examples for util.hmac.

## `util.hmac()`

Synchronous HMAC signature. Payload: at most 5242880 bytes; secret: at most 65536 UTF-8 bytes.

Invalid types/options throw TypeError; size/range throws RangeError.

### Signature

```ts theme={null}
static hmac(
      payload: Uint8Array | string,
      secret: string,
      algorithm?: 'sha1' | 'sha256' | 'sha512',
      encoding?: 'hex' | 'base64',
    ): string;
```

### Example

```ts theme={null}
const signature = util.hmac('payload', secret, 'sha256', 'hex');
```

See [all util methods](https://docs.revoengine.com/low-code/reference/util.md) or [runtime basics](https://docs.revoengine.com/low-code/overview.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.