My eyes hurt at the sight of
"msnID - Math.floor(msnID / 4294967296)*4294967296"
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
(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