adding and fetching docs

This commit is contained in:
2018-09-19 20:29:48 +02:00
parent d9aa8deb16
commit 8d93af6552
11 changed files with 416 additions and 270 deletions

View File

@@ -0,0 +1,13 @@
function norm_to_ascii(string){return unescape(encodeURIComponent(string))};
function norm_to_unicode(string){return decodeURIComponent(escape(string))};
function crypt_sym(string,k){return String.fromCharCode.apply(undefined,string.split("").map(function(c){return c.charCodeAt(0)^(k||13)}))};
export function encrypt(string, key) {
//Encrypt a string
return btoa(crypt_sym(norm_to_ascii(string), key));
}
export function decrypt(string, key) {
//Decrypt a string
return crypt_sym(norm_to_unicode(atob(string)), key);
}