HEX
Server: LiteSpeed
System: Linux spg20.cloudpowerdns.com 5.14.0-611.35.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Feb 25 03:46:09 EST 2026 x86_64
User: carrerup (3153)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: //proc/thread-self/root/opt/bitninja-dispatcher/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;