View Single Post
nunoabc
Senior Member
Join Date: Aug 2007
Location: Portugal, VN Gaia
Old 08-22-2010 , 13:24   Re: Convert STEAMID to Steam Community ID
Reply With Quote #249

I'm currently doing two PHP scripts. One does the job similar to the SteamProfile and the other one is like NoobSticks SteamID converter. While I am doing it, I tried to write it mathematically (more or less) so that the persons that don't understand any other explication could understand and I came up with this:
Code:
Base = 76561197960265728
SteamID = STEAM_0:Server:ID (= STEAM_0:0:15973075)
ProfileID = Base + Server + 2 x ID (= 76561197992211878)

IDtemp = ProfileID - Base (= 31946150)
Server = IDtemp % 2 (= 0)
ID = (IDtemp - Server) / 2 (= 15973075)
SteamID = STEAM_0:Server:ID = STEAM_0:0:15973075
Notes:
  • Base it's the value corresponding to the following SteamID: STEAM_0:0:0;
  • Server is something I saw (or I think I saw) someone calling to the second part of the SteamID;
  • Regarding the IDtemp variable, I thought that this way it would be more simpler;
  • The % sign refers to modulus operator in PHP, which gives us the remainder of a division. So in this case it's the remainder of IDtemp divided by 2;
  • The SteamID here used is mine, so if you have any questions, you can use my steam page to leave a comment.
If for some reason the final result isn't what is expected, please let me now. If everything is correct, I would really like to know as well.
__________________

Last edited by nunoabc; 08-22-2010 at 18:38.
nunoabc is offline