Skip to content

What is bint in @briklab/net-t?

bint is a high-performance, proxy-driven array designed to store numerical data using the absolute minimum byte-count possible. While a standard JavaScript array treats every number as a 64-bit float (consuming 8 bytes per slot), bint dynamically analyzes your data to pack it into the tightest binary representation (Uint8, Int16, Float32, etc.).

Key Features:

  • Dynamic Packing: It automatically finds the best Type for your number. If you push a 255, it uses 1 byte. If you push a 1.5, it scales to a float.
  • Feels like a array: It looks and feels like a regular array (b[0], b.length, for...of), but it’s actually a "Logic-Layer" sitting over a raw ArrayBuffer.
  • Zero-Waste Serialization: When you call .toBuffer(), it generates a perfectly packed ArrayBuffer ready for transport over WebSockets or storage in IndexedDB.