Shoutbox

PHP MSN UserID [SOLVED] - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: PHP MSN UserID [SOLVED] (/showthread.php?tid=88834)

PHP MSN UserID [SOLVED] by Spunky on 01-31-2009 at 07:56 PM

PHP code:
function UserId($email) {
    for($x=0, $i=0; $i < strlen($email); $i++){
      $y = ord(substr($email, $i, 1));
      $x *= 101;
      $x += $y;
      $x %= 4294967296;
    }
    return $x;
}


Any idea why that won't work? It says division by zero =/
RE: PHP MSN UserID by MeEtc on 01-31-2009 at 08:00 PM

PHP code:
function get_msnid ($email){
   $email = strtolower($email);
   for ($msnid=0,$i=0; $i < strlen($email); $i++) {
      $msnid *= 101;
      $msnid += ord($email[$i]);
      while($msnid >= pow(2,32))
         $msnid -= pow(2,32);
   }
   return $msnid;
}


RE: PHP MSN UserID by Spunky on 01-31-2009 at 08:02 PM

That'll do nicely :p

</shex>