Browse Source

Added account.py

pull/35/head
philippj 9 years ago
parent
commit
250912777e
  1. 4
      steam/guard.py

4
steam/guard.py

@ -1,11 +1,9 @@
import struct import struct
import hashlib
from binascii import hexlify from binascii import hexlify
from time import time from time import time
from steam import webapi from steam import webapi
from steam.core.crypto import hmac_sha1, sha1_hash from steam.core.crypto import hmac_sha1, sha1_hash
def generate_twofactor_code(shared_secret): def generate_twofactor_code(shared_secret):
"""Generate Steam 2FA code for login with current time """Generate Steam 2FA code for login with current time
@ -86,5 +84,5 @@ def generate_device_id(steamid):
:return: android device id :return: android device id
:rtype: str :rtype: str
""" """
h = hexlify(str(hashlib.sha1(str(steamid).encode('ascii')))).decode('ascii') h = hexlify(sha1(str(steamid).encode('ascii'))).decode('ascii')
return "android:%s-%s-%s-%s-%s" % (h[:8], h[8:12], h[12:16], h[16:20], h[20:32]) return "android:%s-%s-%s-%s-%s" % (h[:8], h[8:12], h[12:16], h[16:20], h[20:32])

Loading…
Cancel
Save