# Signature.toDerHex

Converts a [`Signature.Signature`](/api/Signature/types#signature) to DER-encoded format.

## Imports

:::code-group
```ts [Named]
import { Signature } from 'ox'
```

```ts [Entrypoint]
import * as Signature from 'ox/Signature'
```
:::

## Examples

```ts twoslash
import { Signature } from 'ox'

const signature = Signature.from({
  r: '0x6e100a352ec6ad1b70802290e18aeed190704973570f3b8ed42cb9808e2ea6bf',
  s: '0x4a90a229a244495b41890987806fcbd2d5d23fc0dbe5f5256c2613c039d76db8'
})

const signature_der = Signature.toDerHex(signature)
// @log: '0x304402206e100a352ec6ad1b70802290e18aeed190704973570f3b8ed42cb9808e2ea6bf02204a90a229a244495b41890987806fcbd2d5d23fc0dbe5f5256c2613c039d76db8'
```

## Definition

```ts
function toDerHex(
  signature: Signature<boolean>,
): Hex.Hex
```

**Source:** [src/core/Signature.ts](https://github.com/wevm/ox/blob/main/src/core/Signature.ts#L1010)

## Parameters

### signature

* **Type:** `Signature<boolean>`

The signature to convert.

#### signature.r

* **Type:** `0x${string}`

#### signature.s

* **Type:** `0x${string}`

#### signature.yParity

* **Type:** `numberType`
* **Optional**

## Return Type

The DER-encoded signature.

`Hex.Hex`
