SystemRage / py-kms

KMS Server Emulator written in Python
The Unlicense
2.04k stars 618 forks source link

Fix 0x stripping from HWID #65

Closed edgeyboy closed 4 years ago

edgeyboy commented 4 years ago

str.strip(string) removes all characters contained in the string given to it. This is not the intended behavior, and is a bug previously reported on #52.

>>> "046cf1cff2b9475f".strip("0x")
'46cf1cff2b9475f'

See https://docs.python.org/3.8/library/stdtypes.html#str.strip

I've switched to checking if the string starts with it, and simply removing it if so. Alternatively .strip('0x') could be replaced with .replace('0x', ''), however that would be less clean.