Skip to content

@briklab/net-t

@briklab/net-t provides compact binary serialization for arrays of numbers, automatically choosing the most efficient numeric type for each value. Optimized for low-latency, low-memory communication structures.

Install

Follow the common installation tutorial

API

  • Functions: bint() - Creates a new BintInstance
  • Functions: bint.fromBuffer() - Creates a BintInstance from an ArrayBuffer
  • Type: BintInstance - The main interface for working with binary number arrays
  • Type: TypeName - Union type of supported numeric types

Quick Start

ts
import bint from '@briklab/net-t';

const instance = bint();
instance(42);        // Uint8
instance(3.14);      // Float32
instance(1000000);   // Uint32

const buffer = instance.toBuffer();
const restored = bint.fromBuffer(buffer);
console.log(restored.length); // 3

Diagram

100%Ctrl + wheel to zoom

Live Demo

Recommended to test it in your browser. The test here might not work properly
Console
No logs yet.