HarmonyOS crc32计算问题?

如题:HarmonyOS crc32计算问题?

阅读 390
1 个回答

api12参考如下方法:

let data1 =
  new Int8Array([99, 1, 1, 1, 12, -52, -52, -52, -52, -52, -52, -32, 1, 0, 0, 0, 39, 123, 34, 117, 115, 101, 73, 100,
    34, 58, 34, 57, 56, 55, 54, 53, 52, 51, 50, 49, 34, 44, 34, 118, 105, 110, 34, 58, 34, 49, 50, 51, 52, 53, 54, 55,
    56, 57, 34, 125, 0, 0, 0, 0])
let checksum = zlib.createChecksumSync()
checksum.crc32(0, data1.buffer).then((data) => {
  console.info('crc32 success', data);
}).catch((errData: base.BusinessError) => {
  console.error(`errData is errCode:${errData.code}  message:${errData.message}`);
})

参考文档:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/js-apis-zlib-V5\#crc3212

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
logo
HarmonyOS
子站问答
访问
宣传栏