mirror of
https://github.com/emn178/js-sha256.git
synced 2026-08-12 20:32:16 +08:00
- support for web worker. - typescript types. #10 Changed - prevent webpack to require dependencies.
13 lines
236 B
JavaScript
13 lines
236 B
JavaScript
var imported = false;
|
|
onmessage = function(e) {
|
|
if (imported) {
|
|
postMessage(sha256(e.data));
|
|
if (typeof exports !== 'undefined') {
|
|
imported = false;
|
|
}
|
|
} else {
|
|
imported = true;
|
|
importScripts(e.data);
|
|
}
|
|
}
|