orker.onmessage = function(e) {
        if (!e.isTrusted) {
          return
        }

        console.log('Message received from worker')
        console.debug(e)
        app.ports.hash.send(JSON.stringify(e.data));
      }

       app.ports.crypt.subscribe(function([pass, salt]) {
         worker.postMessage(
           JSON.stringify(
             { tag: 'sha512crypt',
               body: {pass, salt}
             }
           )
         )
       });
    </script>
  </body>
</html>
