Convert Uint8List to String with Dart

后端 未结 4 1850

cipher.process returns an Uint8List which is a list of unsigned integers (0-255). I need to convert this Uint8List to a string that I can easily convert back to the same Uin

4条回答
  •  攒了一身酷
    2021-01-07 19:03

    I guess this should do it:

    String s = new String.fromCharCodes(inputAsUint8List);
    var outputAsUint8List = new Uint8List.fromList(s.codeUnits);
    

提交回复
热议问题