-
-
Save mdnestor/fb360a5220f51872ac83e99c8792e6d4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def seed(x) -> int: | |
if isinstance(x, int): | |
return x | |
s = 0 | |
for c in x: | |
s = ((31*s + ord(c)) ^ 0x80000000) & 0xFFFFFFFF - 0x80000000 | |
return s | |
# print(seed("creashaks organzine")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment