最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

javascript - Steam: Convert SteamID64 to SteamID using PHP - Stack Overflow

matteradmin8PV0评论

How would someone convert steamid64 (example: 76561198074259974) into a steamid (STEAM_0:0:56997123) using PHP/javascript (I would like to display a steamid on a loading screen, but not the steamid64)

How would someone convert steamid64 (example: 76561198074259974) into a steamid (STEAM_0:0:56997123) using PHP/javascript (I would like to display a steamid on a loading screen, but not the steamid64)

Share Improve this question edited Feb 14, 2015 at 15:50 Tomzen asked Feb 14, 2015 at 15:07 TomzenTomzen 551 silver badge4 bronze badges 1
  • Check out this documentation on the API Steam API Documentation – Rimble Commented Feb 14, 2015 at 16:19
Add a ment  | 

1 Answer 1

Reset to default 4

Have a look at the code here for converting steamID to steamID64: https://forums.alliedmods/showthread.php?t=60899?t=60899

You can reverse it for converting steamID64 to steamID, for this the formula would be: (steamID64 - (76561197960265728 + (steamID64 % 2)))/2

This would give you the numbers after the second colon (:). If steamID64 is odd (steamID64 % 2) the number after the first colon would be 1 otherwise a 0.

Post a comment

comment list (0)

  1. No comments so far