ethereumjs-monorepo

@ethereumjs/util


@ethereumjs/util / addHexPrefix

Function: addHexPrefix()

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

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

Adds “0x” to a given string if it does not already start with “0x”.

Parameters

str

string

Returns

`0x${string}`