"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.fromString = (input) => (new TextEncoder()).encode(input);
exports.fromHex = (hexString) => new Uint8Array(hexString.match(/.{1,2}/g).map(byte => parseInt(byte, 16)));
exports.toHex = (bytes) => Array.prototype.reduce.call(bytes, (str, byte) => str + byte.toString(16).padStart(2, '0'), '');
exports.randomBytes = (len) => crypto.getRandomValues(new Uint8Array(len));
function importSecretKey(rawKey) {
    return window.crypto.subtle.importKey('raw', rawKey, 'AES-CBC', true, ['encrypt', 'decrypt']);
}
exports.importSecretKey = importSecretKey;
