M
M
Mark Eshkilev2021-02-16 00:38:43
PHP
Mark Eshkilev, 2021-02-16 00:38:43

How to get short steamid - STEAM_0:1: from long steam ID - 76561198846203651?

Hello, please help me, I am doing authorization on the site using steam and openid, how to get a short steam id from a long one?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
nokimaro, 2021-02-16
@nokimaro

Use this one https://github.com/b3none/steam-id-converter
can convert in both directions
directly, the conversion function looks like this https://github.com/b3none/steam-id-converter/blob/...

S
SFY, 2021-04-27
@SFY

var steamId64 = 76561198032122624;
var universe = (steamId64 >> 56) & 0xFF;
if (universe == 1) universe = 0;
var accountIdLowBit = steamId64 & 1;
var accountIdHighBits = (steamId64 >> 1) & 0x7FFFFFF;
var legacySteamId = "STEAM_" + universe + ":" + accountIdLowBit + ":" + accountIdHighBits;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question