Need help with javascript

ultrex

Newbie
Oct 26, 2009
1
0
Can anyone help me with this javascript?

It's a decoding function, can anyone create encoding function based on it?


Code:
chr13: function(chr14) {
        var chr15 = "";
        var chr16 = 23;
        chr14 = unescape(chr14);
        chr17_ = chr14.replace(/[\D]/gi, "");
        for (i = 0; i < chr17_.length; i += 2) {
            chr18 = parseInt(chr17_.substr(i, [2])) + chr16;
            chr18 = unescape('%' + chr18.toString(16));
            chr15 += chr18;
        }
        chr14 = unescape(chr15);
        output = new String;
        chr19 = new Array();
        chr20 = new Array();
        chr21 = chr14.length;
        for (i = 0; i < chr21; i++) {
            chr19[i] = chr14.charCodeAt(i);
            chr20[i] = chr14.charCodeAt(i + 1);
        }
        for (i = 0; i < chr21; i = i + 2) {
            output += String.fromCharCode(chr19[i] - chr20[i]);
        }
        return output;
    }
Hope someone can help me
 
Programming is about explaining to the computer how to get from A to B in abstract.
You should post input and output samples....:D


BTW this may bring some result (it is just random editing, without sample of coded / decoded text we can't do anything).


Code:
chr13: function(chr14) {
        var chr15 = "";
        var chr16 = 23;
        chr14 = escape(chr14);
//        chr17_ = chr14.replace(/[\D]/gi, "");
        for (i = 0; i < chr17_.length; i += 2) {
            chr18 = parseInt(chr17_.substr(i, [2])) + chr16;
            chr18 = escape('%' + chr18.toString(16));
            chr15 += chr18;
        }
        chr14 = escape(chr15);
        output = new String;
        chr19 = new Array();
        chr20 = new Array();
        chr21 = chr14.length;
        for (i = 0; i < chr21; i++) {
            chr19[i] = chr14.charCodeAt(i);
            chr20[i] = chr14.charCodeAt(i + 1);
        }
        for (i = 0; i < chr21; i = i + 2) {
            output += String.fromCharCode(chr19[i] - chr20[i]);
        }
        return output;
    }
 
Last edited:
Back
Top
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features and essential functions on BlackHatWorld and other forums. These functions are unrelated to ads, such as internal links and images. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock