static List<int> stringToBuffer(String string) { var buf = Uint8List(string.length); for (var i = 0, l = string.length; i < l; i++) { buf[i] = string.codeUnitAt(i); } return buf; }