Skip to main content

Type uint8

Caution

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

Information

  • Used to represent integers from 0 to 255.
  • Uses 1 byte for storage.
  • Use a number for encoding.

Example Usage

index.ts
import { Serializer, t } from "encodexx"
const serializer = new Serializer({
height: t.uint8,
age: t.uint8,
params: [t.uint8]
})
serializer.encode({
height: 172,
age: 19,
params: [90, 60, 90]
})