17 lines
769 B
JavaScript
17 lines
769 B
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.isBrowserCryptoAvailable = exports.getSubtleCrypto = exports.getBrowerCrypto = void 0;
|
|
function getBrowerCrypto() {
|
|
return (global === null || global === void 0 ? void 0 : global.crypto) || (global === null || global === void 0 ? void 0 : global.msCrypto) || {};
|
|
}
|
|
exports.getBrowerCrypto = getBrowerCrypto;
|
|
function getSubtleCrypto() {
|
|
const browserCrypto = getBrowerCrypto();
|
|
return browserCrypto.subtle || browserCrypto.webkitSubtle;
|
|
}
|
|
exports.getSubtleCrypto = getSubtleCrypto;
|
|
function isBrowserCryptoAvailable() {
|
|
return !!getBrowerCrypto() && !!getSubtleCrypto();
|
|
}
|
|
exports.isBrowserCryptoAvailable = isBrowserCryptoAvailable;
|
|
//# sourceMappingURL=crypto.js.map
|