Created
January 2, 2019 23:55
-
-
Save MRuy/4400d8141f99eecfd806737b11ba4294 to your computer and use it in GitHub Desktop.
Converting steam32 id to steam64 with native BigInt in ES6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function steam32To64(steam32) { | |
const SteamID64Identifier = 76561197960265728n; | |
const sidSplit = steam32.split(':'); | |
const z = BigInt(sidSplit[2]); | |
const y = BigInt(sidSplit[1]); | |
return (SteamID64Identifier + (z * 2n) + y); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment