Commit 0ed71ce1 authored by David Haynes's avatar David Haynes 🙆

Merge branch '158-visually-similar-characters' into '2.3-dev'

Resolve "prevent visually similar characters from appearing in the same generated url"

See merge request !117
parents 5391518f 4dacf707
Pipeline #2453 failed with stages
in 1 minute and 45 seconds
......@@ -19,8 +19,21 @@ from django.utils import timezone
from hashids import Hashids # http://hashids.org/python/
# generate the salt and initialize Hashids
# note: the Hashids library already implements several restrictions
# on character placement, including repeating or incrementing numbers,
# or placing curse word characters adjacent to one another
similar_chars = set(['b', 'G', '6',
'g', 'q',
'l', '1', 'I',
'S', '5',
'O', '0',])
alphanumerics = set(string.ascii_letters + string.digits)
link_chars = ''.join(alphanumerics - similar_chars)
HASHIDS = Hashids(
salt="srct.gmu.edu", alphabet=(string.ascii_lowercase + string.digits)
salt="srct.gmu.edu", alphabet=(link_chars)
)
class RegisteredUser(models.Model):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment