Last active
February 23, 2019 08:40
-
-
Save OfficialSubZero/1c21c4e14669bf464d1bacee51d01531 to your computer and use it in GitHub Desktop.
Converts 64 bit SteamID's to 32 bit in PHP easily :D Enjoy!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function convertSteamID($steamid64) { | |
| $authserver = bcsub($steamid64, '76561197960265728') & 1; | |
| $authid = (bcsub($steamid64, '76561197960265728')-$authserver)/2; | |
| return "STEAM_0:$authserver:$authid"; | |
| } | |
| /* | |
| Example using steam OpenID. https://github.com/SmItH197/SteamAuthentication: | |
| $steamid = $_SESSION['steamid']; | |
| echo convertSteamID($steamid); | |
| */ | |
| ?> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment