encodeBase64 static method
将 bytes 转换为 Base64 编码字符串
bytes 源数据,Uint8List 类型
返回结果: String Base64 编码字符串
示例:
Uint8List raw = utf8.encode('hello') as Uint8List;
String base64Str = EncryptUtil.encodeBase64(raw);
print(base64Str); // aGVsbG8=
Implementation
static String encodeBase64(Uint8List bytes) {
return base64.encode(bytes);
}