mirror of
https://github.com/emn178/js-md5.git
synced 2026-08-13 04:51:44 +08:00
- support for web worker. #11 Changed - throw error if input type is incorrect. - prevent webpack to require dependencies.
13 lines
233 B
JavaScript
13 lines
233 B
JavaScript
var imported = false;
|
|
onmessage = function(e) {
|
|
if (imported) {
|
|
postMessage(md5(e.data));
|
|
if (typeof exports !== 'undefined') {
|
|
imported = false;
|
|
}
|
|
} else {
|
|
imported = true;
|
|
importScripts(e.data);
|
|
}
|
|
}
|