Skip to content

Instantly share code, notes, and snippets.

@HelloKS
Created November 11, 2021 13:27
Show Gist options
  • Save HelloKS/91d57daea6bc770ff14a9e844e51b299 to your computer and use it in GitHub Desktop.
Save HelloKS/91d57daea6bc770ff14a9e844e51b299 to your computer and use it in GitHub Desktop.
Unity engine registry hash generation (windows)
def hash_djb2(s):
hash = 5381
for x in s:
hash = hash * 33 ^ ord(x)
return hash & 0xFFFFFFFF
print(hash_djb2(u'YourPrefKeyHere'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment