| 1 | import 'dart:convert'; |
| 2 | |
| 3 | String hexToUtf8(String hexAddress) { |
| 4 | if (hexAddress.length % 2 != |
| 5 | throw ArgumentError("Hexadecimal string must have an even number of characters."); |
| 6 | } |
| 7 | |
| 8 | // Convert the hexadecimal string to bytes |
| 9 | List<int> bytes = [ |
| 10 | for (int i = 0 |
| 11 | ]; |
| 12 | |
| 13 | // Decode the bytes to a UTF-8 string |
| 14 | return utf8.decode(bytes); |
| 15 | } |