Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Fredrik Wieczerkowski
curry-libs
Commits
af93910d
Commit
af93910d
authored
Jul 04, 2018
by
Michael Hanus
Browse files
Fixes security issue w.r.t. random seeds w.r.t. zero minutes
parent
e71405d2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Random.curry
View file @
af93910d
...
...
@@ -191,9 +191,9 @@ getRandomSeed =
getCPUTime >>= \msecs ->
let (CalendarTime y mo d h m s _) = toUTCTime time
#ifdef __PAKCS__
in return ((y+mo+d+h+
m*s*
msecs) `rem` mask)
in return ((y+mo+d+h+
(m+1)*(s+1)*(
msecs
+1)
) `rem` mask)
#else
in return ((y+mo+d+h+
m*s
*(msecs+1)) `mod` two16)
in return ((y+mo+d+h+
(m+1)*(s+1)
*(msecs+1)) `mod` two16)
#endif
--- Computes a random permutation of the given list.
...
...
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