これは Steam ID でも API KEY でもないのですが、パッと探しても情報がでてきずらいのでメモしておきます。
account_id とは
- STEAM ID が 64-bit の ID
- STEAM ID の 32-bit 版 が account_id
生成方法
- STEAMID64 - 76561197960265728 = STEAMID32
- STEAMID32 + 76561197960265728 = STEAMID64
- OR
- STEAMID32 = The right-most 32-bits of STEAMID64
- STEAMID64 = concatenate("00000001000100000000000000000001", STEAMID32);
出典: https://dev.dota2.com/showthread.php?t=58317
define("STEAM_ID_UPPER_32_BITS", "00000001000100000000000000000001");
// gets the lower 32-bits of a 64-bit steam id
function GET_32_BIT ($ID_64) {
$upper = gmp_mul( bindec(STEAM_ID_UPPER_32_BITS) , "4294967296" );
return gmp_strval(gmp_sub($ID_64,$upper));
}
// creates a 64-bit steam id from the lower 32-bits
function MAKE_64_BIT ( $ID_32, $hi = false ) {
if ($hi === false) {
$hi = bindec(STEAM_ID_UPPER_32_BITS);
}
// workaround signed/unsigned braindamage on x32
$hi = sprintf ( "%u", $hi );
$ID_32 = sprintf ( "%u", $ID_32 );
return gmp_strval ( gmp_add ( gmp_mul ( $hi, "4294967296" ), $ID_32 ) );
}
https://gist.github.com/almirsarajcic/4664387
以上。