This repository has been archived by the owner on Aug 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
api util.codec
Ivan Volkov edited this page Jun 18, 2021
·
4 revisions
Represents the codec namespace with its fields.
- SAP Help
https://help.sap.com/doc/3de842783af24336b6305a3c0223a369/2.0.03/en-US/$.util.codec.html
- Module
https://github.com/SAP/xsk/blob/main/modules/api/api-xsjs/src/main/resources/xsk/util/codec/codec.js
- Sample usage:
var codec = $.util.codec;
var util = $.util;
// encode the string value to hex data
var encodedHex = codec.encodeHex("dirigible as hex");
//returns ArrayBuffer
var decodedHex = codec.decodeHex(encodedHex);
//Converts an ArrayBuffer containing UTF-8 encoded string to a JavaScript String object
var valueFromHex = util.stringify(decodedHex);
// encode the string value base64 data
var encodedToBase64 = codec.encodeBase64("dirigible as base64");
//returns ArrayBuffer
var decodedBase64 = codec.decodeBase64(encodedToBase64);
//Converts an ArrayBuffer containing UTF-8 encoded string to a JavaScript String object
var valueFromBase64 = util.stringify(decodedBase64);
- Methods
Members | Description | Type |
---|---|---|
decodeBase64(base64Data) | Decodes Base64 data | ArrayBuffer |
decodeHex(hexData) | Decodes hexadecimal data. | ArrayBuffer |
encodeBase64(data) | Encodes data into Base64. | String |
encodeHex(data) | Encodes data into hexadecimal format. | String |
- Issues
- Unit Tests
- Integration Tests ❌
✅ - Feature implemented and working as supposed.
❌ - Feature not implemented yet.