mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 09:56:05 -04:00
Implement registering with shared secret.
This commit is contained in:
parent
58367a9da2
commit
69135f59aa
4 changed files with 83 additions and 5 deletions
|
@ -16,6 +16,10 @@
|
|||
import random
|
||||
import string
|
||||
|
||||
_string_with_symbols = (
|
||||
string.digits + string.ascii_letters + ".,;:^&*-_+=#~@"
|
||||
)
|
||||
|
||||
|
||||
def origin_from_ucid(ucid):
|
||||
return ucid.split("@", 1)[1]
|
||||
|
@ -23,3 +27,9 @@ def origin_from_ucid(ucid):
|
|||
|
||||
def random_string(length):
|
||||
return ''.join(random.choice(string.ascii_letters) for _ in xrange(length))
|
||||
|
||||
|
||||
def random_string_with_symbols(length):
|
||||
return ''.join(
|
||||
random.choice(_string_with_symbols) for _ in xrange(length)
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue