def _create_confirmation_params(self, tag_string: str) -> dict: timestamp = int(time.time()) confirmation_key = guard.generate_confirmation_key( self._identity_secret, tag_string, timestamp) android_id = guard.generate_device_id(self._my_steam_id) return { 'p': android_id, 'a': self._my_steam_id, 'k': confirmation_key, 't': timestamp, 'm': 'android', 'tag': tag_string }
def _create_confirmation_params(self, tag_string: str) -> dict: timestamp = int(time.time()) # 生成当前时间的交易确认码 confirmation_key = guard.generate_confirmation_key( self._identity_secret, tag_string, timestamp) # 生成设备 ID android_id = guard.generate_device_id(self._my_steam_id) return { "p": android_id, "a": self._my_steam_id, "k": confirmation_key, "t": timestamp, "m": "android", "tag": tag_string }
def test_generate_device_id(self): steam_id = "12341234123412345" device_id = guard.generate_device_id(steam_id) self.assertEquals(device_id, "android:677cf5aa-3300-7807-d1e2-c408142742e2")