PHP WebShell

Текущая директория: /opt/BitGoJS/node_modules/nx/src/hasher

Просмотр файла: hashing-impl.js

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.defaultHashing = exports.HashingImpl = void 0;
const crypto_1 = require("crypto");
const fs_1 = require("fs");
class HashingImpl {
    hashArray(input) {
        const hasher = (0, crypto_1.createHash)('sha256');
        for (const part of input) {
            // intentional single equals to check for null and undefined
            if (part != undefined) {
                hasher.update(part);
            }
        }
        return hasher.digest('hex');
    }
    hashFile(path) {
        const hasher = (0, crypto_1.createHash)('sha256');
        const file = (0, fs_1.readFileSync)(path);
        hasher.update(file);
        return hasher.digest('hex');
    }
}
exports.HashingImpl = HashingImpl;
exports.defaultHashing = new HashingImpl();
//# sourceMappingURL=hashing-impl.js.map

Выполнить команду


Для локальной разработки. Не используйте в интернете!