mirror of
https://github.com/emn178/js-sha1.git
synced 2026-11-17 14:18:44 +08:00
- TypeScript interfaces. #6, #9 - HMAC feature. - support for web worker. #14 ### Fixed - deprecated `new Buffer`, replace with `Buffer.from`. #10 - dependencies and security issues. - refactor: simplify formatMessage internal logic. - Generates incorrect hash in some cases. ### Changed - remove `eval` and use `require` directly. #8 - throw error by Error oject. - throw error if update after finalize - use unsigned right shift.
13 lines
234 B
JavaScript
13 lines
234 B
JavaScript
var imported = false;
|
|
onmessage = function(e) {
|
|
if (imported) {
|
|
postMessage(sha1(e.data));
|
|
if (typeof exports !== 'undefined') {
|
|
imported = false;
|
|
}
|
|
} else {
|
|
imported = true;
|
|
importScripts(e.data);
|
|
}
|
|
}
|