<?php | |
function convert_steamid_64bit_to_32bit($id) | |
{ | |
$result = substr($id, 3) - 61197960265728; | |
return (string) $result; | |
} | |
function convert_steamid_32bit_to_64bit($id) | |
{ | |
$result = '765'.($id + 61197960265728); | |
return (string) $result; | |
} | |
$sixtyfour = '76561197992765754'; | |
$thirtytwo = '32500026'; | |
var_dump(convert_steamid_32bit_to_64bit($thirtytwo) === $sixtyfour); // bool(true) | |
var_dump(convert_steamid_64bit_to_32bit($sixtyfour) === $thirtytwo); // bool(true) |
This comment has been minimized.
This comment has been minimized.
Thanks :) |
This comment has been minimized.
This comment has been minimized.
Thanks for this! |
This comment has been minimized.
This comment has been minimized.
Thanks! I needed this. |
This comment has been minimized.
This comment has been minimized.
wow so simple thanks, also how did you get the base number? like what was your source? just out of curiosity. |
This comment has been minimized.
This comment has been minimized.
Very useful! I'd also be interested to know what your source was, if you can remember. |
This comment has been minimized.
This comment has been minimized.
Awesome stuff +1 |
This comment has been minimized.
This comment has been minimized.
Doesnt work. It produces a false number converting 32 to 64. |
This comment has been minimized.
This comment has been minimized.
I was testing this on Xampp for Windows and it didn't worked. I'm guessing that this have something to do with the unavailability of the 64-bit version of both Xampp and PHP for Windows. I'll test this on a Linux to see if the result is right. |
This comment has been minimized.
This comment has been minimized.
@danfsd, this was intended for 32-bit PHP environments and that unavailability was the reason I created this. |
This comment has been minimized.
This comment has been minimized.
Would you happen to know a direct relation for Group ID as well? |
This comment has been minimized.
This comment has been minimized.
Thanks! you saved much time for me |
This comment has been minimized.
wow this is awesome!!