初始化环境文件
This commit is contained in:
27
node_modules/@aws-crypto/sha256-browser/build/module/crossPlatformSha256.js
generated
vendored
Normal file
27
node_modules/@aws-crypto/sha256-browser/build/module/crossPlatformSha256.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
import { Sha256 as WebCryptoSha256 } from "./webCryptoSha256";
|
||||
import { Sha256 as JsSha256 } from "@aws-crypto/sha256-js";
|
||||
import { supportsWebCrypto } from "@aws-crypto/supports-web-crypto";
|
||||
import { locateWindow } from "@aws-sdk/util-locate-window";
|
||||
import { convertToBuffer } from "@aws-crypto/util";
|
||||
var Sha256 = /** @class */ (function () {
|
||||
function Sha256(secret) {
|
||||
if (supportsWebCrypto(locateWindow())) {
|
||||
this.hash = new WebCryptoSha256(secret);
|
||||
}
|
||||
else {
|
||||
this.hash = new JsSha256(secret);
|
||||
}
|
||||
}
|
||||
Sha256.prototype.update = function (data, encoding) {
|
||||
this.hash.update(convertToBuffer(data));
|
||||
};
|
||||
Sha256.prototype.digest = function () {
|
||||
return this.hash.digest();
|
||||
};
|
||||
Sha256.prototype.reset = function () {
|
||||
this.hash.reset();
|
||||
};
|
||||
return Sha256;
|
||||
}());
|
||||
export { Sha256 };
|
||||
//# sourceMappingURL=crossPlatformSha256.js.map
|
||||
Reference in New Issue
Block a user