snowflake: remove unused get_invite_code

blueprints.invites uses its own gen_inv_code() function, that
is reasonably faster than the original.
This commit is contained in:
Luna 2019-03-20 02:05:35 -03:00
parent d20626e716
commit 55dbe4f5a2
1 changed files with 0 additions and 8 deletions

View File

@ -41,14 +41,6 @@ WORKER_ID = 1
Snowflake = int Snowflake = int
def get_invite_code() -> str:
"""Get a random invite code."""
random_stuff = hashlib.sha512(os.urandom(1024)).digest()
code = base64.urlsafe_b64encode(random_stuff).decode().replace('=', '5') \
.replace('_', 'W').replace('-', 'm')
return code[:6]
def _snowflake(timestamp: int) -> Snowflake: def _snowflake(timestamp: int) -> Snowflake:
"""Get a snowflake from a specific timestamp """Get a snowflake from a specific timestamp