diff --git a/confluent_server/confluent/collective/invites.py b/confluent_server/confluent/collective/invites.py index 94c0906f..b635dbeb 100644 --- a/confluent_server/confluent/collective/invites.py +++ b/confluent_server/confluent/collective/invites.py @@ -24,7 +24,8 @@ pending_invites = {} def create_server_invitation(servername): servername = servername.encode('utf-8') - invitation = os.urandom(66) + randbytes = (3 - ((len(servername) + 2) % 3)) % 3 + 64 + invitation = os.urandom(randbytes) pending_invites[servername] = invitation return base64.b64encode(servername + b'@' + invitation)