API Reference / @evolu/common / Buffer

Buffer

Classes

ClassDescription
BufferErrorCustom error for Buffer-related failures like premature end of data. Provides better stack traces for debugging binary protocol issues.

Interfaces

InterfaceDescription
BufferA Buffer is a dynamic, resizable container for binary data, optimized for scenarios where the final size is unknown. It grows exponentially (doubling its capacity) to minimize memory reallocations and uses subarray for efficient, copy-free data access in methods like unwrap and shift.

Functions

FunctionDescription
bytesToHexConvert byte array to hex string. Uses built-in function, when available.
bytesToUtf8Converts bytes to string using UTF8 encoding.
concatBytesCopies several Uint8Arrays into one.
createBuffer-
hexToBytesConvert hex string to byte array. Uses built-in function, when available.
utf8ToBytesConverts string to bytes using UTF8 encoding.

Was this page helpful?