ethereumjs-monorepo

@ethereumjs/util


@ethereumjs/util / addHexPrefix

Function: addHexPrefix()

addHexPrefix(str): `0x${string}`

Defined in: packages/util/src/bytes.ts:284

Add a 0x prefix when the string is not already hex-prefixed.

Parameters

str

string

Returns

`0x${string}`