Chatto/src/main/frontend/workers/encryption-worker/main.ts
Rohan Sircar 3822e9fb3c Refactored frontend
Preparing for multi-module frontend package layout
2020-06-20 15:18:06 +05:30

9 lines
339 B
TypeScript

import registerPromiseWorker from 'promise-worker/register';
import * as sjcl from 'sjcl'
registerPromiseWorker((payload) => {
// console.log(payload)
// console.log('decrypted = ' + sjcl.decrypt(payload.passphrase, JSON.stringify(payload.cipher)));
return sjcl.decrypt(payload.passphrase, JSON.stringify(payload.cipher))
});