[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [Type](https://evolu.dev/docs/api-reference/common/Type) › UInt32

```ts
const UInt32: brand(
  "UInt32",
  lessThanOrEqualTo(4294967295)(NonNegativeInt),
);
```

Defined in: [packages/common/src/Type.ts:12373](https://github.com/evoluhq/evolu/blob/bc4578a260dd15d5bbf94b83765ca05984d194cb/packages/common/src/Type.ts#L12373)

Unsigned 32-bit [NonNegativeInt](https://evolu.dev/docs/api-reference/common/Type/variables/NonNegativeInt).

Accepts integers from 0 through 4294967295, inclusive, the range of unsigned
32-bit integers in Protocol Buffers and of the JavaScript `>>>` operator.
Like [NonNegativeInt](https://evolu.dev/docs/api-reference/common/Type/variables/NonNegativeInt), it accepts `-0`. [UInt64](https://evolu.dev/docs/api-reference/common/Type/variables/UInt64) is the unsigned
64-bit bigint counterpart.

### Example

```ts
import {
  assertEqual,
  assertErr,
  assertOk,
  NonNegativeInt,
  UInt32,
} from "@evolu/common";

assertOk(UInt32.fromUnknown(0), 0);
assertOk(UInt32.fromUnknown(4294967295), 4294967295);
assertErr(UInt32.fromUnknown(-1), { type: "NonNegative", value: -1 });

const tooLarge = UInt32.fromUnknown(4294967296);
assertErr(tooLarge, {
  type: "LessThanOrEqualTo4294967295",
  value: 4294967296,
  max: 4294967295,
});
assertEqual(
  UInt32.formatError(tooLarge.error),
  "The value 4294967296 must be less than or equal to 4294967295.",
);

// A UInt32 is a NonNegativeInt.
const count: NonNegativeInt = UInt32.orThrow(42);
assertEqual(count, 42);
```