mirror of
https://github.com/emn178/js-sha256.git
synced 2026-08-13 04:51:56 +08:00
Added
- support for web worker. - typescript types. #10 Changed - prevent webpack to require dependencies.
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
var imported = false;
|
||||
onmessage = function(e) {
|
||||
if (imported) {
|
||||
postMessage(sha256(e.data));
|
||||
if (typeof exports !== 'undefined') {
|
||||
imported = false;
|
||||
}
|
||||
} else {
|
||||
imported = true;
|
||||
importScripts(e.data);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user