importScripts('openpgp.worker.min.js');

sha256 = window.openpgp.crypto.hash.sha256;

var iterateOverSHA = function(seed) {
  var i;
  for (i = 0; i < 1024; i++) {
    var x = sha256(seed + i);

    if (x.charCodeAt(31) == 0) {
      postMessage(i);
    }
  }

  postMessage("12345");
};

onmessage = function(e) {
  iterateOverSHA(e.data.pow);
};

importScripts('openpgp.worker.min.js');

var sha256 = window.openpgp.crypto.hash.sha256;

var iterateOverSHA = function(seed) {
  var i;
  for (i = 0; i < 1024; i++) {
    var x = sha256(seed + i);

    if (x[31] == 0) {
      postMessage(i);
    }
  }

  postMessage("12345");
};

var onmessage = function(e) {
  iterateOverSHA(e.data.pow);
};

Align proof of work to the api change in openpgpjs
Align proof of work to the api change in openpgpjs
