Skip to main content

Type uint16

Caution

If a value passed to .encode() is outside the uint16 range, an error will be thrown.

Information

  • Used to represent integers from 0 to 65,535.
  • Uses 2 bytes for storage.
  • Use a number for encoding.

Example Usage

index.ts
import { Serializer, t } from "encodexx"
const serializer = new Serializer({
height: t.uint16,
width: t.uint16,
})
serializer.encode({
height: 1800,
width: 2000
})