HarmonyOS base64编解码?

如题:HarmonyOS base64编解码?

阅读 437
1 个回答

指南参考链接:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/js-apis-util-V5\#base64helper9

示例参考:

import { util } from '@kit.ArkTS';

let base64 = new util.Base64Helper();
let base64skData = base64.decodeSync("MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCjSASCSzDPoXFq/6V5kXhhdH+gLaalmhZ+FNJZCx8Rr94po93Y85Icww
o2jQvnx8tRX0mof0Sk1GqgqSUHniXOJewu6KHDt8wZTnY8ncB");

let ua = new Uint8Array([64, 0, 9, 0, 4, 8, 255, 0, 0, 0, 8, 0])
let baseua = base64.encodeToStringSync(ua);
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
logo
HarmonyOS
子站问答
访问
宣传栏