title: SteamID convert from Steam64 (sid)
body: <p>I need to convert from Steam64 to SteamID. Target game : CS 1.6.</p>
  <p>I need to got result like:</p>
  <p>*<strong>sid\90071996842377567</strong> to <strong>STEAM_2:1:2051985959</strong></p>
  <p>*<strong>sid\90071996842377536</strong> to <strong>STEAM_1:1:514099334</strong></p>
  <p>But my function, convert it to STEAM_0...</p>
  <pre><code>    public static string CalculateSteamId(ulong sid)
      {
          ulong authId = sid - 76561197960265728;
          int serverId = authId % 2 != 0 ? 1 : 0;
          authId = authId / 2;
          return string.Format(&quot;STEAM_0:{0}:{1}&quot;, serverId, authId);
      }
  </code></pre>
  <p>Some one know how to convert to really STEAM_X:Y:Z from sid?</p>
  <p>I tried next function: (from another stackoverflow question)</p>
  <pre><code>        var universe = (steamId64 &gt;&gt; 56) &amp; 0xFF;
          var accountIdLowBit = steamId64 &amp; 1;
          var accountIdHighBits = (steamId64 &gt;&gt; 1) &amp; 0x7FFFFFF;
          return string.Format(&quot;STEAM_{0}:{1}:{2}&quot;, universe, accountIdLowBit, accountIdHighBits);
  </code></pre>
  <p>But it return invalid STEAM_X:Y:Z combination.</p>