js字符串加解密
// 字符串加密 export function enCode (code) { var c=String.fromCharCode(code.charCodeAt(0)+code.length); for(var i=1;i<code.length;i++){ c+=String.fromCharCode(code.charCodeAt(i)+code.charCodeAt(i-1)); } return escape(c); } // 字符串解密 export function deCode(code){ code = unescape(code); var c=String.fromCharCode(code.charCodeAt(0)-code.length); for(var i=1;i<code.length;i++){ c+=String.fromCharCode(code.charCodeAt(i)-c.charCodeAt(i-1)); } return c; }
sunshine15666