BytesUtils class
A utility class for working with binary data represented as lists of integers (bytes).
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
compareBytes(
List< int> a, List<int> b) → int - Compare two Uint8Lists lexicographically.
-
fromBinary(
String data, {int zeroPadByteLen = 0}) → List< int> - Converts a binary string to a list of bytes.
-
fromHexString(
String data, {bool paddingZero = false}) → List< int> -
Converts a hexadecimal string
data
into a List of integers representing bytes. -
toBinary(
List< int> dataBytes, {int zeroPadBitLen = 0}) → String - Converts a list of bytes to a binary string representation.
-
toBytes(
List< int> bytes, {bool unmodifiable = false}) → List<int> - Ensures that each byte is properly represented as an 8-bit integer.
-
toHexString(
List< int> dataBytes, {bool lowerCase = true, String? prefix}) → String -
Converts a List of integers representing bytes,
dataBytes
, into a hexadecimal string. -
tryFromHexString(
String? data) → List< int> ? -
Tries to convert a hexadecimal string
data
into a List of integers. -
tryToBytes(
List< int> ? bytes, {bool unmodifiable = false}) → List<int> ? -
tryToHexString(
List< int> ? dataBytes, {bool lowerCase = true, String? prefix}) → String? -
Tries to convert a list of integers representing bytes,
dataBytes
, into a hexadecimal string. -
validateBytes(
List< int> bytes) → void - Validates a list of integers representing bytes.
-
xor(
List< int> dataBytes1, List<int> dataBytes2) → List<int> - Performs a bitwise XOR operation on two lists of bytes.