mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-07-09 22:42:19 +08:00
feat: use rust mail-parser (#104)
* feat: imp worker v2 * feat: add rust mail-parser * feat: imp frontend v2 * feat: imp frontend v2 * feat: update doc * feat: add mailV1Alert * feat: remove unused
This commit is contained in:
@@ -1,24 +0,0 @@
|
||||
diff --git a/lib/stream-hash.js b/lib/stream-hash.js
|
||||
index 3f9b44133766c04866ab2ab178c061f35dbf8f42..368ed6d94da4401909b7eddc87d18354947daf33 100644
|
||||
--- a/lib/stream-hash.js
|
||||
+++ b/lib/stream-hash.js
|
||||
@@ -7,19 +7,15 @@ class StreamHash extends Transform {
|
||||
constructor(attachment, algo) {
|
||||
super();
|
||||
this.attachment = attachment;
|
||||
- this.algo = (algo || 'md5').toLowerCase();
|
||||
- this.hash = crypto.createHash(algo);
|
||||
this.byteCount = 0;
|
||||
}
|
||||
|
||||
_transform(chunk, encoding, done) {
|
||||
- this.hash.update(chunk);
|
||||
this.byteCount += chunk.length;
|
||||
done(null, chunk);
|
||||
}
|
||||
|
||||
_flush(done) {
|
||||
- this.attachment.checksum = this.hash.digest('hex');
|
||||
this.attachment.size = this.byteCount;
|
||||
done();
|
||||
}
|
||||
Reference in New Issue
Block a user