import 'dart:convert'; import 'dart:typed_data'; // For Uint8List void main() { final String encodedString = "rmMinHb0nBEDsewjQ7sb6CDJSykZN/+K01v8JUwujcW5AGM536ekozYdG/xrElN4EFCCfxr0UhI4Xb/YeHwgEOYBkCVlibF/nhD6Kcvq7lx5aHe6muqRtgD81rFxkd1MY5DcQP3trafhUZwCogobE72dsZngdZj9ZkMXjfcS//YOF4G2wp4mzECJadJAC2l1P8gtUCtQNqnH9Aus7Defxhk0t1rGYpTrn70z4eIoAeyR4J5+KCFSQFzd/9jyhAgBGiw622pCPk5aLM3M6hagVoHBPuu+yfIErLW9juXFLuTj1YOUMCr+DPz+qhGqlnO3avhD0kPLopEHBjxSvDktSA=="; // Decode the Base64 string to a Uint8List (list of bytes) Uint8List decodedBytes = base64Decode(encodedString); // Print the first few bytes (as the output is binary, full printing might be unreadable) print('Decoded bytes (first 20): ${decodedBytes.sublist(0, decodedBytes.length > 20 ? 20 : decodedBytes.length)}'); print('Decoded data length: ${decodedBytes.length} bytes'); // If you want to try to interpret it as a UTF-8 string (though it's a ZIP, so it won't be readable) try { String decodedText = utf8.decode(decodedBytes); print('Attempted to decode as UTF-8 string (unlikely to be readable for ZIP): $decodedText'); } catch (e) { print('Could not decode as UTF-8: $e'); } // To confirm it's a ZIP, you can check the first bytes for 'PK' if (decodedBytes.length >= 2 && decodedBytes[0] == 0x50 && decodedBytes[1] == 0x4B) { print('The decoded data appears to be a ZIP file (starts with PK).'); } }
Standard input is empty
Decoded bytes (first 20): [174, 99, 34, 156, 118, 244, 156, 17, 3, 177, 236, 35, 67, 187, 27, 232, 32, 201, 75, 41] Decoded data length: 256 bytes Could not decode as UTF-8: FormatException: Bad UTF-8 encoding 0xae (at offset 0)