Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jean Michel Rouly
research-questions
Commits
f996c80d
Commit
f996c80d
authored
Mar 21, 2014
by
Jean Michel Rouly
Browse files
Reduced number of possible students to a reasonable size
parent
95f4a469
Changes
1
Hide whitespace changes
Inline
Side-by-side
researchquestions/website/models.py
View file @
f996c80d
...
...
@@ -76,8 +76,9 @@ def anonymized( obj ):
obj
.
user
.
username
)
h
=
user_hash_raw
.
hexdigest
()
n
=
int
(
h
,
base
=
16
)
noun_hash
=
int
(
str
(
n
)[:
4
])
*
2
# 4 digits *2 allows for 20 000 nouns
adj_hash
=
int
(
str
(
n
)[
4
:
6
])
*
8
# 2 digits *8 allows for 800 users
noun_hash
=
int
(
str
(
n
)[:
2
])
*
3
# 2 digits *3 allows for 300 nouns
adj_hash
=
int
(
str
(
n
)[
2
:
4
])
*
2
# 1 digits *20 allows for 200 adjs
# 300 * 200 = 60 000 total possible usernames
adj
=
"Anonymous"
adjs
=
open
(
settings
.
DICTIONARY_ADJECTIVES
,
'r'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment