ethereumjs-monorepo

@ethereumjs/util


@ethereumjs/util / isHexString

Function: isHexString()

isHexString(value, length?): value is `0x${string}`

Defined in: packages/util/src/internal.ts:35

Return whether value is a 0x-prefixed hex string, optionally requiring an exact byte length.

Parameters

value

string

length?

number

When set, the hex body must contain exactly this many bytes

Returns

value is `0x${string}`