Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
158
Issues
158
List
Board
Labels
Milestones
Merge Requests
11
Merge Requests
11
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
haskell-gargantext
Commits
99f25621
Commit
99f25621
authored
Sep 11, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Clean] + missing file
parent
9b14cdf1
Pipeline
#1055
canceled with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
4 deletions
+33
-4
Machine.hs
src/Gargantext/Prelude/Crypto/Pass/Machine.hs
+3
-4
User.hs
src/Gargantext/Prelude/Crypto/Pass/User.hs
+30
-0
No files found.
src/Gargantext/Prelude/Crypto/Pass.hs
→
src/Gargantext/Prelude/Crypto/Pass
/Machine
.hs
View file @
99f25621
{-|
Module : Gargantext.Prelude.Crypto.Pass
Module : Gargantext.Prelude.Crypto.Pass
.Machine
Description :
Copyright : (c) CNRS, 2017-Present
License : Public Domain
...
...
@@ -7,8 +7,7 @@ Maintainer : team@gargantext.org
Stability : experimental
Portability : POSIX
To avoid weak password, just offer an easy way to make "good" one and
let user add his own entropy.
Random Text generator (for machines mainly)
Thanks to
https://zuttobenkyou.wordpress.com/2011/12/23/simple-password-generation-with-haskell/
...
...
@@ -16,7 +15,7 @@ https://zuttobenkyou.wordpress.com/2011/12/23/simple-password-generation-with-ha
-}
module
Gargantext.Prelude.Crypto.Pass
module
Gargantext.Prelude.Crypto.Pass
.Machine
where
import
Data.List
(
nub
)
...
...
src/Gargantext/Prelude/Crypto/Pass/User.hs
0 → 100644
View file @
99f25621
{-|
Module : Gargantext.Prelude.Crypto.Pass.User
Description :
Copyright : (c) CNRS, 2017-Present
License : Public Domain
Maintainer : team@gargantext.org
Stability : experimental
Portability : POSIX
-}
module
Gargantext.Prelude.Crypto.Pass.User
where
import
Data.List
((
!!
))
import
Gargantext.Prelude
import
System.Random
getRandomIndex
::
Foldable
t
=>
t
a
->
IO
Int
getRandomIndex
list
=
randomRIO
(
0
,
(
length
list
-
1
))
getRandomElement
::
[
b
]
->
IO
b
getRandomElement
list
=
do
index
<-
(
getRandomIndex
list
)
pure
(
list
!!
index
)
generatePassword
::
(
Num
a
,
Enum
a
)
=>
a
->
[
b
]
->
IO
[
b
]
generatePassword
size
wlist
=
mapM
(
\
_
->
getRandomElement
wlist
)
[
1
..
size
]
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