1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
5 /* Copyright © 2015, Deutsche Telekom, Inc. */
10 byteArrayToHexString: function byteArrayToHexString(array) {
13 let len = array ? array.length : 0;
14 for (let i = 0; i < len; i++) {
15 let hex = (array[i] & 0xff).toString(16);
16 hex = (hex.length === 1) ? "0" + hex : hex;
20 return hexStr.toUpperCase();
23 hexStringToByteArray: function hexStringToByteArray(hexStr) {
24 if (typeof hexStr !== "string" || hexStr.length % 2 !== 0) {
29 for (let i = 0, len = hexStr.length; i < len; i += 2) {
30 array.push(parseInt(hexStr.substr(i, 2), 16));
36 arraysEqual: function arraysEqual(a1, a2) {
41 if (a1.length !== a2.length) {
45 for (let i = 0, len = a1.length; i < len; i++) {
46 if (a1[i] !== a2[i]) {
55 this.EXPORTED_SYMBOLS = ["SEUtils"];