Skip to content

@lelantos-org/sdk / core / fieldToBytes32

Function: fieldToBytes32() โ€‹

ts
function fieldToBytes32(x): Hex32;

Defined in: @lelantos-org/sdk/dist/core/hex.d.ts:24

Format a field element as a 0x-prefixed, zero-padded 32-byte hex word.

Range-checked because this brands its result Hex32 through the unvalidated escape hatch, and the output feeds ABI encoding and persisted note records. (-1n).toString(16) is "-1", which padStart(64) pads to a 64-character string containing a minus sign โ€” long enough to pass a length check โ€” and 2n ** 256n overflows to 65 digits with padStart a no-op.

Parameters โ€‹

ParameterType
xbigint

Returns โ€‹

Hex32

Lelantosno cookies ๐Ÿช ยท no tracking ๐Ÿ‘๏ธ ยท no accounts ๐Ÿ‘คwalletexplorer4536080GitHub