u8aToU8a function
Implementation
Uint8List u8aToU8a(dynamic value, {bool useDartEncode = true}) {
if (value is ByteBuffer) {
return value.asUint8List();
} else if (value is Uint8List) {
return value;
} else if (value is String) {
return convertString(value, useDartEncode: useDartEncode);
} else if (value is List<int> && value.isNotEmpty) {
return convertArray(value);
} else {
return Uint8List.fromList([]);
}
}