Mirror Engine
V5
How To
Mirror Engine Logo

Mirror Engine API


Mirror Engine API / math / intToBytes32

Function: intToBytes32()

function intToBytes32(i: number): number[]

Convert an 32 bit integer into an array of 4 bytes.

Parameters

i

number

Number holding an integer value.

Returns

number[]

An array of 4 bytes.

Example

// Set bytes to [0x11, 0x22, 0x33, 0x44]
const bytes = math.intToBytes32(0x11223344)
Mirror Engine Logo