0

Steams Open ID only returns the Steam ID 64:

For example: 76561198025336843

How can I convert it to the real Steam ID?

For example: STEAM_0:1:32535557

Is there a way to obtain the Information?

Christian Gollhardt
  • 16,510
  • 17
  • 74
  • 111

1 Answers1

3

That is absolutly possible. The real Steam ID can be calculated from the 64-bit integer (long).

Basicly we can extract the following two informations using some calculations:

  • The authentification Server
  • The authentification Id

With this informations, we can concatenate the Steam ID. Here are two Utility methods for it:

public static string GetSteamId(string steamId64)
{
    return GetSteamId(long.Parse(steamId64));
}

public static string GetSteamId(long steamId64)
{
    var authserver = (steamId64 - 76561197960265728) & 1;
    var authid = (steamId64 - 76561197960265728 - authserver) / 2;
    return $"STEAM_0:{authserver}:{authid}";
}

Usage:

var result = GetSteamId("76561198025336843");
//result: STEAM_0:1:32535557
Christian Gollhardt
  • 16,510
  • 17
  • 74
  • 111