This pull request updates the method for generating the DEFAULT_DEVICE_ID in the codebase. The previous method used a random number, while the new method utilizes the SHA256 hash of the current timestamp. This change provides a more secure and unique identifier for simulating Android devices, and it reduces the block chance.
Changes Made:
Replaced the previous DEFAULT_DEVICE_ID generation method with a new one.
Utilized the SHA256 hash of the current timestamp to generate a unique identifier.
Restricted the length of the generated hash to the first 16 characters.
Mitigated potential blocking risks.
Code Changes:
-import random
- DEFAULT_DEVICE_ID = f"android-{random.randint(0, 1e24):x}"
+ import hashlib
+ import time
+ DEFAULT_DEVICE_ID = 'android-%s' % hashlib.sha256(str(time.time()).encode()).hexdigest()[:16]
Please review and merge this pull request if you find it more officiant. Thank you!
Description:
This pull request updates the method for generating the DEFAULT_DEVICE_ID in the codebase. The previous method used a random number, while the new method utilizes the SHA256 hash of the current timestamp. This change provides a more secure and unique identifier for simulating Android devices, and it reduces the block chance.
Changes Made:
Code Changes:
Please review and merge this pull request if you find it more officiant. Thank you!