Pogledajte određenu poruku
Staro 21. 10. 2009.   #1
35-68
Душан Бошкић
Qualified
 
Avatar 35-68
 
Datum učlanjenja: 11.09.2005
Lokacija: 11277 Ugrinovci
Poruke: 109
Hvala: 67
384 "Hvala" u 17 poruka
35-68 is on a distinguished road35-68 is on a distinguished road35-68 is on a distinguished road35-68 is on a distinguished road
Pošaljite poruku preko MSN za 35-68 Pošaljite poruku preko Skype™ za 35-68
Post [JS] Jednostavan String encrypt-decrypt bez kompresije

K๔d:
var c_Secret = {
    _regExp: new RegExp("\\d{3}", "g"),
    _number: 160,
    f_Encrypt: function(s_String) {
        var Encrypt="", Encrypted="", i=0, j=0, text=escape(s_String.split("").reverse());
        while (i < text.length) {
            Encrypted += text[i].charCodeAt(0) + this._number;
            i++;
        }
        Encrypted = Encrypted.match(this._regExp);
        while (j < Encrypted.length) {
            Encrypt += String.fromCharCode(Encrypted[j]);
            j++;
        }
        return Encrypt;
    },
    f_Decrypt: function(s_String) {
        var Decrypt="", Decrypted="", i=0, j=0, text;
        while (i < s_String.length) {
            Decrypted += s_String.charCodeAt(i);
            i++;
        }
        text = Decrypted.match(this._regExp);
        while (j < text.length) {
            Decrypt += String.fromCharCode(text[j] - this._number);
            j++;
        }
        return unescape(Decrypt).split(",").reverse().join("");
    }
};
K๔d:
c_Secret.f_Encrypt("devprotalk.com");
c_Secret.f_Decrypt("čลาใďลาใăลาใฮลาใċลาใČลาใāลาใĔลาใďลาใĒลาใĐลาใĖลาใąลาใĄ");
__________________
In brightest day, in blackest night ...
35-68 je offline   Odgovorite uz citat
2 članova zahvaljuje 35-68 za poruku: