-
-
Save ivlists/5002519 to your computer and use it in GitHub Desktop.
Blowfish encryption library implementation for Google app scripts (Precisely - Docs).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function escape(t) | |
{ | |
var r=''; | |
for(var i=0;i<t.length;i++){ | |
var c=t.charCodeAt(i); | |
var t1=Math.floor(c/16); | |
var t2=c%16; | |
if (t1<10) t1+=48; | |
else t1+=55; | |
if (t2<10) t2+=48; | |
else t2+=55; | |
r+=String.fromCharCode(t1)+String.fromCharCode(t2); | |
} | |
return r; | |
}; | |
function unescape(t) | |
{ | |
var r=''; | |
for(i=0;i<t.length;i++){ | |
var t1=t.charCodeAt(i++); | |
var t2=t.charCodeAt(i); | |
if (t1<58) t1-=48; | |
else { | |
if (t1>96) t1-=87; | |
else t1-=55; | |
} | |
if (t2<58) t2-=48; | |
else { | |
if (t2>96) t2-=87; | |
else t2-=55; | |
} | |
r+=String.fromCharCode(t1*16+t2); | |
} | |
return r; | |
}; |
Your gist isn't Blowfish. It's ASCII shifting. However, your "complete implementation of this script" link above appears to be far more elaborate than this Gist.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For more details:
The complete implementation of this script can be found here -
https://script.google.com/d/1l23aUzJBCfy5QZAxtZGiXyy3XOv0JtDoSrjFhzlEh7R4qaz-XoDuLoKk/edit