Shoutbox

MSN ID calculator - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: MSN ID calculator (/showthread.php?tid=60241)

MSN ID calculator by Eljay on 06-06-2006 at 08:56 AM

I saw someone ask for this in a thread yesterday but the thread sort of disappeared so im going to post it here :P

code:
function msnID(email)
{
    var msnID = 0;
    email = email.toLowerCase();
    for(i = 0; i < email.length; i++){
        msnID = msnID * 101 + email.charCodeAt(i);
        msnID = msnID - Math.floor(msnID / 4294967296) * 4294967296;
    }
    return msnID;
}

Hope it helps someone :)
RE: MSN ID calculator by CookieRevised on 06-06-2006 at 09:03 AM

My eyes hurt at the sight of "msnID - Math.floor(msnID / 4294967296)*4294967296" :P
Use the modular arithmetic function (modulo) instead:

Javascript code:
function UserId(email) {
    email = email.toLowerCase();
    var x = 0;
    for(i=0; i < email.length; i++){
        x *= 101
        x += email.charCodeAt( i );
        x %= 4294967296;
    }
    return x;
}

or in a very short way:
Javascript code:
function UserId(email) {
    email = email.toLowerCase();
    for(var x=0, i=0; i < email.length; i++) x = (x * 101 + email.charCodeAt( i )) % 4294967296;
    return x;
}





EDIT: Since this thread has been moved from the beta testing pages to the public pages, here are related links regarding calculating the MSN ID:

* First public publication ever of the method from the magic man who discovered it :p (incl. lots of discussions)
      msn6 user id thingy
      Equivalent thread on MSNFanatic forums:
        http://forums.fanatic.net.nz/index.php?showtopic=6910&st=20


* Small standalone program to calculate the MSN ID:
      Choli's reply to msn6 user id thingy

* Small online utility to calculate the MSN ID:
      http://messenger.jonathankay.com/msngrid.aspx

* Proper VB6 code to calculate the MSN ID (also lists some checks you can do to test your own code):
      CookieRevised's reply to msn6 user id thingy



RE: MSN ID calculator by Eljay on 06-06-2006 at 09:05 AM

get out :(

i mean... umm... thanks :P


RE: MSN ID calculator by Pai on 06-06-2006 at 09:54 AM

Keep in mind that if you want your own ID, just use

code:
var ID = Messenger.MyUserId;