![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/magento/module-two-factor-auth/view/adminhtml/web/js/u2fkey/ |
/** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([], function () { 'use strict'; return { /** * Constructor * * @returns {self} * @constructor */ 'Magento_TwoFactorAuth/js/u2fkey/utils': function () { return this; }, /** * Convert an array buffer to base64 * * @param {ArrayBuffer} buffer * @returns {String} * @private */ arrayBufferToBase64: function (buffer) { var binary = '', // eslint-disable-next-line no-undef bytes = new Uint8Array(buffer), len = bytes.byteLength, i = 0; for (i = 0; i < len; i++) { binary += String.fromCharCode(bytes[i]); } return window.btoa(binary) .replace(/\-/g, '+') .replace(/_/g, '/'); }, /** * Convert a Uint8Array to a UTF-8 string using cross-browser safe methods * * @param {Uint8Array} uint8array * @param {Function} callback * @private */ asyncUint8ArrayToUtf8String: function (uint8array, callback) { var blob = new Blob([uint8array]), fileReader = new FileReader(); /** * Handle loaded * * @param {Event} e */ fileReader.onload = function (e) { callback(e.target.result); }; fileReader.readAsText(blob); } }; });