Solved

whats this code

Posted on 2010-09-18
10
262 Views
Last Modified: 2012-05-10
hello there,
I would like to know whats this code doing and the output.. I see it on one of my web pages..
thanks
function KSer(u) {

    var g = 16;

    var h = 32;

    var a = 65;

    var i = 90;

    var j = 48;

    var b = 57;

    var c = 58;

    var d = 63;

    var e = 91;

    var f = 94;

    var t = 0;

    var w = 0;

    var za = 0;

    var z = 0;

    var o = [];

    var p = null;

    var k = [];

    var s = [];

    var r = [];

    var q = [];

    for (var m = 0; m < 10; m++) {

        k.push(0);

        s.push(0);

    }

    for (var n = 0; n < 10; n++) {

        s.push(0);

        r.push(0);

        q.push(0);

    }

    var x = function (zb)

    {

        var ze = window.event ? new Date().getTime() : zb.timeStamp;

        var zc = window.event ? window.event.keyCode : zb.which;

        zc %= 128;

        if ((zc >= a && zc <= i) || zc == h) {

            t++;

        }

        else if (zc >= j && zc <= b) {

            w++;

        }

        else if (zc >= c && zc <= d || zc >= e && zc <= f) {

            za++;

        }

        else {

            z++;

        }

        o[zc] = ze;

        if (p)

        {

            var zd = ze - p;

            if (zd >= 0 && ((zc >= a && zc <= i) || zc == h))

            {

                if (zd < 400) {

                    s[Math.floor(zd  / 20)]++;

                }

                else if (zd < 1000) {

                    r[Math.floor((zd - 400)  / 60)]++;

                }

                else if (zd < 3000) {

                    q[Math.floor((zd - 1000)  / 200)]++;

                };

            }

        }

        p = ze;

    };

    var y = function (zc)

    {

        var ze = window.event ? new Date().getTime() : zc.timeStamp;

        var zd = window.event ? window.event.keyCode : zc.which;

        var zb = ze - o[zd % 128];

        if (zb >= 50 && zb < 250) {

            k[Math.floor((zb - 50)  / 20)]++;

        }

    };

    var v = function (zb)

    {

        var zd = Math.max.apply(Math, zb);

        var zc = [];

        zb.each(function (ze)

        {

            zc.push(Math.floor(ze * 64 / (zd || 1)));

        });

        return zc;

    };

    var l = function ()

    {

        var zb = s.concat(r, q);

        return v(zb).concat(v(k), [t / 2, w / 2, za / 2, z / 2]);

    };

    this.getData = function ()

    {

        return Base64.encodeNums(l());

    };

    Event.listen(u, {

        keyup : y.bind(this), keydown : x.bind(this)

    });

}

Open in new window

0
Comment
Question by:XK8ER
  • 5
  • 4
10 Comments
 
LVL 37

Expert Comment

by:Neil Russell
Comment Utility
First question would be IF Its YOUR website, who put it there??
0
 
LVL 1

Author Comment

by:XK8ER
Comment Utility
its not being hosted online I just want to know what it is..
0
 
LVL 75

Expert Comment

by:Michel Plungjan
Comment Utility
I see someone on the web asking to recode it in PHP.

I cannot debug it without the rest of the page.

Please post the rest including any JS file loaded.
0
 
LVL 1

Author Comment

by:XK8ER
Comment Utility
there are way too many files.. maybe if you tell me whats missing I can look for it..
0
 
LVL 1

Author Comment

by:XK8ER
Comment Utility
I found some data that might belong to this..
function startKSer(a)

{

    a.KSerester = new KSer(document);

}





function setKSer(a)

{

    a.KSerest_data.value = a.KSerester.getData();

    return true;

}





onloadRegister(function (){startKSer($("lop"));});







<input value="Submit" onclick="setKSer($(&#039;reg&#039;));" type="submit" />

Open in new window

0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 75

Expert Comment

by:Michel Plungjan
Comment Utility
Do you have facebook code in that page?
0
 
LVL 1

Author Comment

by:XK8ER
Comment Utility
no but its conded in html php and javascript..
0
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 500 total points
Comment Utility
I understand, but the pages I have seen so far using onloadRegister are using FBML
0
 
LVL 1

Author Comment

by:XK8ER
Comment Utility
of so this FBML, is safe.. how can I see an output of this code or test this code?
0
 
LVL 75

Expert Comment

by:Michel Plungjan
Comment Utility
I do not know without seeing the appropriate js
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now