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
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
valueto bytes with specifiedlengthandendianness. -
boolToInt(
bool value) → int -
Converts a boolean
valueto an integer (0 or 1). -
bytesEqual(
Uint8List? bytes1, Uint8List? bytes2) → bool -
Checks if two byte arrays
bytes1andbytes2are equal. -
bytesToBigInt(
Uint8List bytes, {Endianness endianness = Endianness.Big}) → BigInt -
Converts
bytesto a BigInt with the specifiedendianness. -
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
bytesto an integer with the specifiedendianness. -
byteToHexString(
int value) → String -
Converts a single byte
valueto 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
valueto bytes with specifiedlengthandendianness. -
intToHexString(
int value, int length, {Endianness endianness = Endianness.Big}) → String -
Converts an integer
valueto a hex string with specifiedlengthandendianness.