HEX
Server: LiteSpeed
System: Linux kapuas.iixcp.rumahweb.net 5.14.0-427.42.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 1 14:58:02 EDT 2024 x86_64
User: mirz4654 (1666)
PHP: 8.1.33
Disabled: system,exec,escapeshellarg,escapeshellcmd,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,mail,posix_getwpuid
Upload Files
File: //opt/alt/alt-nodejs10/root/usr/lib/node_modules/npm/node_modules/sha/index.js
'use strict'

var Transform = require('stream').Transform
var crypto = require('crypto')
var fs = require('graceful-fs')

exports.check = check
exports.checkSync = checkSync
exports.get = get
exports.getSync = getSync
exports.stream = stream

function check(file, expected, options, cb) {
  if (typeof options === 'function') {
    cb = options
    options = undefined
  }
  expected = expected.toLowerCase().trim()
  get(file, options, function (er, actual) {
    if (er) {
      if (er.message) er.message += ' while getting shasum for ' + file
      return cb(er)
    }
    if (actual === expected) return cb(null)
    cb(new Error(
        'shasum check failed for ' + file + '\n'
      + 'Expected: ' + expected + '\n'
      + 'Actual:   ' + actual))
  })
}
function checkSync(file, expected, options) {
  expected = expected.toLowerCase().trim()
  var actual
  try {
    actual = getSync(file, options)
  } catch (er) {
    if (er.message) er.message += ' while getting shasum for ' + file
    throw er
  }
  if (actual !== expected) {
    var ex = new Error(
        'shasum check failed for ' + file + '\n'
      + 'Expected: ' + expected + '\n'
      + 'Actual:   ' + actual)
    throw ex
  }
}


function get(file, options, cb) {
  if (typeof options === 'function') {
    cb = options
    options = undefined
  }
  options = options || {}
  var algorithm = options.algorithm || 'sha1'
  var hash = crypto.createHash(algorithm)
  var source = fs.createReadStream(file)
  var errState = null
  source
    .on('error', function (er) {
      if (errState) return
      return cb(errState = er)
    })
    .on('data', function (chunk) {
      if (errState) return
      hash.update(chunk)
    })
    .on('end', function () {
      if (errState) return
      var actual = hash.digest("hex").toLowerCase().trim()
      cb(null, actual)
    })
}

function getSync(file, options) {
  options = options || {}
  var algorithm = options.algorithm || 'sha1'
  var hash = crypto.createHash(algorithm)
  var source = fs.readFileSync(file)
  hash.update(source)
  return hash.digest("hex").toLowerCase().trim()
}

function stream(expected, options) {
  expected = expected.toLowerCase().trim()
  options = options || {}
  var algorithm = options.algorithm || 'sha1'
  var hash = crypto.createHash(algorithm)

  var stream = new Transform()
  stream._transform = function (chunk, encoding, callback) {
    hash.update(chunk)
    stream.push(chunk)
    callback()
  }
  stream._flush = function (cb) {
    var actual = hash.digest("hex").toLowerCase().trim()
    if (actual === expected) return cb(null)
    cb(new Error(
        'shasum check failed for:\n'
      + '  Expected: ' + expected + '\n'
      + '  Actual:   ' + actual))
    this.push(null)
  }
  return stream
}