I'm trying to convert Steam ID 32bit to Steam ID 64bit.
My javascript function is not working right but same function in python works fine. Python function is copied from How can I get a steamid 64 from a steamID in python
function steamidTo64(steamid) {
let steam64id = 76561197960265728; // Valve's magic constant
let id_split = steamid.split(":");
steam64id += parseInt(id_split[2]) * 2;
if (id_split[1] == "1") {
steam64id += 1;
}
return steam64id;
}
Using input of STEAM_1:1:191000236
function should return 76561198342266201
, but instead it returns 76561198342266200
Using input of STEAM_1:1:3645504
function should return 76561197967556737
, but it returns 76561197967556740
Using input of STEAM_0:0:570629725
function should return 76561199101525178
, but it returns 76561199101525180