2 lines
1.7 KiB
JavaScript
2 lines
1.7 KiB
JavaScript
/*! OpenPGP.js v3.0.3 - 2018-03-19 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */
|
|
!function e(n,r,t){function o(i,f){if(!r[i]){if(!n[i]){var s="function"==typeof require&&require;if(!f&&s)return s(i,!0);if(a)return a(i,!0);var u=new Error("Cannot find module '"+i+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[i]={exports:{}};n[i][0].call(c.exports,function(e){var r=n[i][1][e];return o(r||e)},c,c.exports,e,n,r,t)}return r[i].exports}for(var a="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}({1:[function(e,n,r){self.window={},importScripts("openpgp.min.js");var t=window.openpgp,o=[],a=!1,i=4e4,f=6e4,s=2e4;function u(e){!a&&t.crypto.random.randomBuffer.size<i&&self.postMessage({event:"request-seed",amount:s}),self.postMessage(e,t.util.getTransferables(e.data))}t.crypto.random.randomBuffer.init(f,function(){return a||self.postMessage({event:"request-seed",amount:f}),a=!0,new Promise(function(e,n){o.push(e)})}),self.onmessage=function(e){var n=e.data||{};switch(n.event){case"configure":!function(e){for(var n in e)t.config[n]=e[n]}(n.config);break;case"seed-random":!function(e){e instanceof Uint8Array||(e=new Uint8Array(e));t.crypto.random.randomBuffer.set(e)}(n.buf);var r=o;o=[];for(var a=0;a<r.length;a++)r[a]();break;default:!function(e,n,r){if("function"!=typeof t[n])return void u({id:e,event:"method-return",err:"Unknown Worker Event"});r=t.packet.clone.parseClonedPackets(r,n),t[n](r).then(function(n){u({id:e,event:"method-return",data:t.packet.clone.clonePackets(n)})}).catch(function(n){u({id:e,event:"method-return",err:n.message,stack:n.stack})})}(n.id,n.event,n.options||{})}}},{}]},{},[1]); |