[u16; 2]
Array 650 v393About This Type
Fixed-length array of 2 u16 values.
Always exactly 2 elements. No length prefix needed since the size is known at compile time.
Encoding: 2 elements encoded consecutively, no length prefix.
Fixed-Length Array
- Element Type
- u16
- Length
- 2
- SCALE Encoding
- Fixed-length (2 x element size bytes)
SCALE Encoding
- Rule
- 2 elements encoded consecutively, no length prefix (size known at compile time).
- Size
- 2 x sizeof(u16)
Examples
Array of 2 u16 = [u16; 2]
0x<2 x u16>2 elements Each u16 encoded consecutivelyCode Examples
import { TypeRegistry } from "@polkadot/types";
const registry = new TypeRegistry();
// Encode a [u16; 2]
const arr = registry.createType("[u16; 2]", new Uint8Array(2));
console.log("Hex:", arr.toHex());Referenced By (1)
Type Information
- Type ID
- 650
- Kind
- Array
- Runtime
- v393