calculateMD5V2 static method

Future<String> calculateMD5V2(
  1. String filePath
)

这个计算md5会比上面原生的快4倍,视频大的时候更明显

Implementation

static Future<String> calculateMD5V2(String filePath) async {
  if(Platform.isAndroid || Platform.isIOS){
    final res = await Md5FileChecksum.getFileChecksum(filePath: filePath);
    return hex.encode(base64Decode(res));
  }
  return calculateMD5SumAsyncWithCrypto(filePath);
}