BinaryFormat.UnsignedInteger32

Binary

A binary format that reads a 32-bit unsigned integer.

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

BinaryFormat.UnsignedInteger32(binary as binary) as any

Parameters

NameTypeRequiredDescription
binarybinaryYesThe binary data to read the 32-bit unsigned integer from.

Return Value

functionA binary format function that reads a 4-byte unsigned integer from binary data.

Remarks

BinaryFormat.UnsignedInteger32 is a binary format specifier that reads a 32-bit (4-byte) unsigned integer from binary data. The value range is 0 to 4,294,967,295 (UInt32 / uint).

The default byte order is little-endian (least significant byte first). Use BinaryFormat.ByteOrder to wrap this format if the source data uses big-endian byte ordering.

This format is widely used in binary file formats for sizes, offsets, counts, magic numbers, and other 32-bit unsigned values. Many file format headers (e.g., PNG, ZIP) use unsigned 32-bit integers extensively.

Examples

Example 1: Read a 32-bit unsigned integer

let
    binaryData = #binary({0x01, 0x00, 0x00, 0x00}),
    result = BinaryFormat.UnsignedInteger32(binaryData)
in
    result

Example 2: Read a larger 32-bit unsigned integer

let
    binaryData = #binary({0x00, 0x00, 0x01, 0x00}),
    result = BinaryFormat.UnsignedInteger32(binaryData)
in
    result

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks