# decodeStringKey

> **decodeStringKey**(`bytes`, `offset?`): readonly \[`string`, `number`]

Defined in: [packages/key-encoding/src/scalars.ts:230](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/key-encoding/src/scalars.ts#L230)

Decode one `encodeStringKey` encoding at `offset`, returning the string and the offset after its terminator.

## Parameters

### bytes

`Uint8Array`

### offset?

`number`

## Returns

readonly \[`string`, `number`]

## Throws

`INVALID_KEY_VALUE` or `INVALID_OFFSET`, as [decodeUint32Key](/reference/knotkit/key-encoding/functions/decodeuint32key/).

## Throws

`TRUNCATED_KEY`, `INVALID_ESCAPE_SEQUENCE`, or `TRAILING_BYTES`, as [decodeBytesKey](/reference/knotkit/key-encoding/functions/decodebyteskey/), or `INVALID_UTF8` when the payload is not well-formed UTF-8.
