code: function Curve25519Worker() {
    this.jobs = {};
    this.jobId = 0;
    // BROWSER POLYFILL
    try {
      var work = require('webworkify');
      this.worker = work(require('./curve25519_worker.js'));
    } catch (e) {
      var Worker  = require('./node_polyfills.js').Worker;
      var routine = require('./curve_work_routine.js');
      this.worker = new Worker(routine);
    }
    // this.worker = new Worker(url);
    this.worker.onmessage = function(e) {
      var job = this.jobs[e.data.id];
      if (e.data.error && typeof job.onerror === 'function') {
        job.onerror(new Error(e.data.error));
      } else if (typeof job.onsuccess === 'function') {
        job.onsuccess(e.data.result);
      }
      delete this.jobs[e.data.id];
    }.bind(this);
  }
docs: function workerRoutine () { self.onmessage = function(e) { origCurve25519.curve25519_async[e.data.methodName].apply(null, e.data.args).then(function(result) { self.postMessage({ id: e.data.id, result: result }); }).catch(function(error) { self.postMessage({ id: e.data.id, error: error.message }); }); }; }