I32

Primitive 95 v393

About This Type

Signed 32-bit integer (-2^31 to 2^31 - 1).

Fixed-width 4-byte signed integer.

Encoding: Fixed-width: 4 bytes, little-endian.

Primitive Type

Name
I32
Byte Size
4 bytes
SCALE Encoding
Fixed-width, little-endian

SCALE Encoding

Rule
Fixed-width 4-byte signed two's complement integer, little-endian.
Size
4 bytes

Code Examples

import { TypeRegistry } from "@polkadot/types";

const registry = new TypeRegistry();

// Encode a I32 value
const value = registry.createType("I32", 0);
console.log("Hex:", value.toHex());
console.log("Bytes:", value.toU8a());

Type Information

Type ID
95
Kind
Primitive
Runtime
v393