mercredi 22 juillet 2015

Number generation using bitwise operators

I am trying to generate a random number that fits this format, but I dont quite understand the format. Can someone explain how to generate a "random" SteamID? The format is:

As a 64-bit integer
Given the components of a Steam ID, a Steam ID can be converted to it's 64-bit integer form as follows: 
((Universe << 56) | (Account Type << 52) | (Instance << 32) | Account ID)
Worked Example:
Universe: Public (1)
Account Type: Clan (7)
Instance: 0
Account ID: 4
64-bit integer value: 103582791429521412




Aucun commentaire:

Enregistrer un commentaire