初始化环境文件
This commit is contained in:
18
node_modules/@smithy/hash-stream-node/dist-es/HashCalculator.js
generated
vendored
Normal file
18
node_modules/@smithy/hash-stream-node/dist-es/HashCalculator.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
import { toUint8Array } from "@smithy/util-utf8";
|
||||
import { Writable } from "stream";
|
||||
export class HashCalculator extends Writable {
|
||||
hash;
|
||||
constructor(hash, options) {
|
||||
super(options);
|
||||
this.hash = hash;
|
||||
}
|
||||
_write(chunk, encoding, callback) {
|
||||
try {
|
||||
this.hash.update(toUint8Array(chunk));
|
||||
}
|
||||
catch (err) {
|
||||
return callback(err);
|
||||
}
|
||||
callback();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user