MOON
Server: Apache
System: Linux e2e-78-16.ssdcloudindia.net 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
User: imensosw (1005)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/bitninja-threat-hunting/node_modules/ebg13/index.js
function convertToCharCode(c) {
  return c.charCodeAt();
}

function convertToChar(c) {
  return String.fromCharCode(c);
}

function rotateBy(key) {
  return function rotate(c) {
    if (c >= 65 && c <= 90) {
      return (c + key <= 90) ? c + key : c + key - 90 + 64;
    } else if (c >= 97 && c <= 122) {
      return (c + key <= 122) ? c + key : c + key - 122 + 96;
    }

    return c;
  };
}


function rot13(message, key = 13) {
  if (typeof message !== 'string') {
    return '';
  }

  const rotate = rotateBy(key);

  return message.split('').map(convertToCharCode).map(rotate).map(convertToChar)
    .join('');
}

module.exports = rot13;