Software: Apache. PHP/8.1.30 uname -a: Linux server1.tuhinhossain.com 5.15.0-163-generic #173-Ubuntu SMP Tue Oct 14 17:51:00 UTC uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root) Safe-mode: OFF (not secure) /home/picotech/domains/note.picotech.app/public_html/node_modules/@aws-crypto/sha256-js/build/main/ drwxr-xr-x | |
| Viewing file: Select action/file-type: "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Sha256 = void 0;
var tslib_1 = require("tslib");
var constants_1 = require("./constants");
var RawSha256_1 = require("./RawSha256");
var util_1 = require("@aws-crypto/util");
var Sha256 = /** @class */ (function () {
function Sha256(secret) {
this.secret = secret;
this.hash = new RawSha256_1.RawSha256();
this.reset();
}
Sha256.prototype.update = function (toHash) {
if ((0, util_1.isEmptyData)(toHash) || this.error) {
return;
}
try {
this.hash.update((0, util_1.convertToBuffer)(toHash));
}
catch (e) {
this.error = e;
}
};
/* This synchronous method keeps compatibility
* with the v2 aws-sdk.
*/
Sha256.prototype.digestSync = function () {
if (this.error) {
throw this.error;
}
if (this.outer) {
if (!this.outer.finished) {
this.outer.update(this.hash.digest());
}
return this.outer.digest();
}
return this.hash.digest();
};
/* The underlying digest method here is synchronous.
* To keep the same interface with the other hash functions
* the default is to expose this as an async method.
* However, it can sometimes be useful to have a sync method.
*/
Sha256.prototype.digest = function () {
return tslib_1.__awaiter(this, void 0, void 0, function () {
return tslib_1.__generator(this, function (_a) {
return [2 /*return*/, this.digestSync()];
});
});
};
Sha256.prototype.reset = function () {
this.hash = new RawSha256_1.RawSha256();
if (this.secret) {
this.outer = new RawSha256_1.RawSha256();
var inner = bufferFromSecret(this.secret);
var outer = new Uint8Array(constants_1.BLOCK_SIZE);
outer.set(inner);
for (var i = 0; i < constants_1.BLOCK_SIZE; i++) {
inner[i] ^= 0x36;
outer[i] ^= 0x5c;
}
this.hash.update(inner);
this.outer.update(outer);
// overwrite the copied key in memory
for (var i = 0; i < inner.byteLength; i++) {
inner[i] = 0;
}
}
};
return Sha256;
}());
exports.Sha256 = Sha256;
function bufferFromSecret(secret) {
var input = (0, util_1.convertToBuffer)(secret);
if (input.byteLength > constants_1.BLOCK_SIZE) {
var bufferHash = new RawSha256_1.RawSha256();
bufferHash.update(input);
input = bufferHash.digest();
}
var buffer = new Uint8Array(constants_1.BLOCK_SIZE);
buffer.set(input);
return buffer;
}
//# sourceMappingURL=jsSha256.js.map |
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0033 ]-- |