Convert a big-endian buffer to BigInt (unsigned).
Big-endian byte buffer
BigInt value (always positive)
Convert a big-endian buffer to signed BigInt using two's complement.
Big-endian byte buffer
BigInt value (can be negative)
Convert a little-endian buffer to BigInt (unsigned).
Little-endian byte buffer
BigInt value (always positive)
Convert a little-endian buffer to signed BigInt using two's complement.
Little-endian byte buffer
BigInt value (can be negative)
Convert BigInt to big-endian buffer with specified width.
BigInt value to convert
Desired buffer width in bytes
Big-endian buffer of exactly width bytes
Convert BigInt to big-endian bytes, writing directly into a provided buffer.
BigInt value to convert
Pre-allocated buffer to write into (width is inferred from length)
Convert BigInt to little-endian buffer with specified width.
BigInt value to convert
Desired buffer width in bytes
Little-endian buffer of exactly width bytes
Convert BigInt to little-endian bytes, writing directly into a provided buffer.
BigInt value to convert
Pre-allocated buffer to write into (width is inferred from length)
Extended API with zero-copy buffer operations. These functions write directly into a provided buffer, avoiding allocation.