2👍
✅
struct.unpack('=H', urandom(2))[0]
is just dumb. Just generate an integer in the readable way:
'InvId': random.randrange(2**16),
👤orlp
Source:stackexchange.com