Skip to main content

Function: parseHex()

function parseHex(value, byteLength?): Hex;

Defined in: packages/overcast-core/src/utils.ts:71

Validate an untrusted string as Hex and normalize it to lower case, or throw a HexError. The entry point for anything crossing a boundary the type system doesn't cover: a wire payload, a CLI argument, an environment variable.

Parameters

ParameterTypeDescription
valuestring-
byteLength?numberwhen given, also require exactly this many bytes.

Returns

Hex