HarmonyOS base64编解码?

如题:HarmonyOS base64编解码?

阅读 436
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
子站问答
访问
宣传栏