@ethereumjs/util / toBytes
toBytes(
v):Uint8Array
Defined in: packages/util/src/bytes.ts:234
Coerce supported JavaScript values to bytes.
Accepts hex strings, numbers, bigints, arrays, objects with toBytes(), and null/undefined (empty bytes).
Uint8Array
On invalid strings, negative bigints, or unsupported types