Cocos creator v2.1.3 热更新需不需要md5校验???
谁做过给个例子,自己弄的MD5校验总是报错
没有实现这个热更后的md5校验,现在比较纠结这个到底需不需要??
this._am.setVerifyCallback(function (path, asset) {
// When asset is compressed, we don’t need to check its md5, because zip file have been deleted.
var compressed = asset.compressed;
// Retrieve the correct md5 value.
var expectedMD5 = asset.md5;
// asset.path is relative path and path is absolute.
var relativePath = asset.path;
// The size of asset file, but this value could be absent.
var size = asset.size;
if (compressed) {
self.infoLb.string = "Verification passed : " + relativePath;
return true;
}
else {
self.infoLb.string = "Verification passed : " + relativePath + ’ (’ + expectedMD5 + ‘)’;
return true;
}
});
md5可以保证下载数据正确性,但是校验比较耗性能,正常应该开启的。