What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » MSN ID calculator

MSN ID calculator
Author: Message:
Eljay
Elite Member
*****

Avatar
:O

Posts: 2949
Reputation: 77
– / Male / –
Joined: May 2004
O.P. MSN ID calculator
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 :)
06-06-2006 08:56 AM
Profile PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: MSN ID calculator
My eyes hurt at the sight of "msnID - Math.floor(msnID / 4294967296)*4294967296" :P
Use the modular arithmetic function (modulo) instead:
js 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:
js 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



This post was edited on 08-30-2010 at 11:05 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
06-06-2006 09:03 AM
Profile PM Find Quote Report
Eljay
Elite Member
*****

Avatar
:O

Posts: 2949
Reputation: 77
– / Male / –
Joined: May 2004
O.P. RE: MSN ID calculator
get out :(

i mean... umm... thanks :P
06-06-2006 09:05 AM
Profile PM Find Quote Report
Pai
Full Member
***

w00t !

Posts: 203
Reputation: 2
– / Male / –
Joined: Sep 2003
RE: MSN ID calculator
Keep in mind that if you want your own ID, just use
code:
var ID = Messenger.MyUserId;
06-06-2006 09:54 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On