convert method

  1. @override
List<int> convert(
  1. String s
)
override

Converts input and returns the result of the conversion.

Implementation

@override
List<int> convert(String s) {
  List<int> result = [];
  for (int i = 0; i < s.length; i++) {
    var bytes = utf8.encode(s[i]);
    var value = 0;

    for (var i = 0, length = bytes.length; i < length; i++) {
      value += bytes[i] * (pow(256, (bytes.length - i - 1)) as int);
    }

    result.addAll(UTF_TABLE[value] ?? []);
  }
  return result;
}