1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Need help with javascript

Discussion in 'HTML & JavaScript' started by ultrex, Nov 18, 2009.

  1. ultrex

    ultrex Newbie

    Joined:
    Oct 26, 2009
    Messages:
    1
    Likes Received:
    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
     
  2. AgentOrange_MkUltra

    AgentOrange_MkUltra Junior Member

    Joined:
    May 29, 2009
    Messages:
    180
    Likes Received:
    44
    Occupation:
    Hijacking Your System
    Location:
    Many steps ahead & Behind 4 Proxies + double VPN!
    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: Jan 3, 2010