utils/utils library

Classes

BigintUtils
BigRational
Represents a rational number with arbitrary precision using BigInt for the numerator and denominator.
BitUtils
Class container for bit utility functions.
BytesUtils
A utility class for working with binary data represented as lists of integers (bytes).
CompareUtils
DynamicByteTracker
A utility class for tracking bytes dynamically.
HashCodeGenerator
IntUtils
Utility class for integer-related operations and conversions.
StringUtils
A utility class for working with strings and common string operations.
Tuple<T, R>
A generic Tuple class with two typed elements, T and R. Tuples are immutable, and this class provides a simple way to store pairs of values.

Enums

StringEncoding
An enumeration representing different string encoding options.

Constants

mask13 → const int
A constant representing a 13-bit mask with all relevant bits set to 1.
mask16 → const int
A constant representing a 16-bit mask with all bits set to 1.
mask32 → const int
A constant representing a 32-bit mask with all bits set to 1.
mask8 → const int
A constant representing an 8-bit mask with all bits set to 1.
maxInt32 → const int
maxUint32 → const int
minInt32 → const int
safeInt → const int
safeUint → const int

Properties

maskBig16 BigInt
final
maskBig32 BigInt
final
maskBig64 BigInt
final
maskBig8 BigInt
final
maxInt64 BigInt
final
maxU64 BigInt
final
minInt64 BigInt
final

Functions

add32(int x, int y) int
Adds two 32-bit integers and applies a mask to ensure the result fits within 32 bits.
readUint16BE(List<int> data, [int offset = 0]) int
Reads a 16-bit unsigned integer value in big-endian byte order from a list.
readUint16LE(List<int> array, [int offset = 0]) int
Reads a 16-bit unsigned integer value in little-endian byte order from a list.
readUint32BE(List<int> array, [int offset = 0]) int
Reads a 32-bit unsigned integer value in big-endian byte order from a list.
readUint32LE(List<int> array, [int offset = 0]) int
Reads a 32-bit unsigned integer value in little-endian byte order from a list.
readUint8(List<int> array, [int offset = 0]) int
Reads an 8-bit unsigned integer value from a list.
rotl32(int val, int shift) int
Rotates a 32-bit integer left by a specified number of bits.
rotr32(int val, int shift) int
Rotates a 32-bit integer right by a specified number of bits.
shr16(int x) int
Right-shifts a 32-bit integer by 16 bits and applies a mask to ensure the result fits within 16 bits.
writeUint16BE(int value, List<int> out, [int offset = 0]) → void
Writes a 16-bit unsigned integer value in big-endian byte order to a list.
writeUint16LE(int value, List<int> out, [int offset = 0]) → void
Writes a 16-bit unsigned integer value in little-endian byte order to a list.
writeUint32BE(int value, List<int> out, [int offset = 0]) → void
Writes a 32-bit unsigned integer value in big-endian byte order to a list.
writeUint32LE(int value, List<int> out, [int offset = 0]) → void
Writes a 32-bit unsigned integer value in little-endian byte order to a list.
writeUint64LE(int value, [List<int>? out, int offset = 0]) List<int>
Writes a 64-bit unsigned integer value in little-endian byte order to a list.
zero(List<int> array) → void
Sets all elements in a list to zero.