export function encryptString(string: string, encId: number): string {
  let result: string = "";

  // Encrypt
  for (let i = 0; i < string.length; i++) {
    const code = string.charCodeAt(i);
    const offset = code + encId;
    const offsetChar = String.fromCharCode(offset);
    result += offsetChar;
  }

  return result;
}

export function decryptString(string: string, decId: number): string {
    let result: string = "";

  // Decrypt
  for (let i = 0; i < string.length; i++) {
    const code = string.charCodeAt(i);
    const offset = code - decId;
    const offsetChar = String.fromCharCode(offset);
    result += offsetChar;
  }

  return result;
}
