Pre-release
AdventureJS Docs Downloads
Score: 0 Moves: 0
// deobfuscate.js

/* global adventurejs A */

/**
 * Obfuscate a string. Used to make saved game files
 * non human readable.
 * @method adventurejs.Game#deobfuscate
 * @memberOf adventurejs.Game
 * @param {String} text
 * @returns {String}
 */
adventurejs.deobfuscate = function Adventurejs_deobfuscate(text) {
  return Array.from(text)
    .map((c) => String.fromCharCode(c.charCodeAt(0) - 3))
    .join("");
};