ByteUtils class

Utility class to play with raw bytes.

Provides static methods for converting between bytes, integers, hex strings, and other data formats commonly used in NDEF record processing.

Constructors

ByteUtils()

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

bigIntToBytes(BigInt? value, int length, {dynamic endianness = Endianness.Big}) Uint8List
Converts a BigInt value to bytes with specified length and endianness.
boolToInt(bool value) int
Converts a boolean value to an integer (0 or 1).
bytesEqual(Uint8List? bytes1, Uint8List? bytes2) bool
Checks if two byte arrays bytes1 and bytes2 are equal.
bytesToBigInt(Uint8List bytes, {Endianness endianness = Endianness.Big}) BigInt
Converts bytes to a BigInt with the specified endianness.
bytesToHexString(Uint8List? bytes) String
Converts bytes to hex string, returns an empty string when bytes is null or empty.
bytesToInt(Uint8List? bytes, {Endianness endianness = Endianness.Big}) int
Converts bytes to an integer with the specified endianness.
byteToHexString(int value) String
Converts a single byte value to a 2-character hex string.
hexStringToBytes(String hex) Uint8List
Converts a hex string to bytes.
intToBytes(int value, int length, {Endianness endianness = Endianness.Big}) Uint8List
Converts an integer value to bytes with specified length and endianness.
intToHexString(int value, int length, {Endianness endianness = Endianness.Big}) String
Converts an integer value to a hex string with specified length and endianness.