Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
haskell-gargantext-prelude
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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-prelude
Commits
6346a3e4
Commit
6346a3e4
authored
May 16, 2022
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEAT] QR Code generator
parent
08096a49
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
76 additions
and
4 deletions
+76
-4
gargantext-prelude.cabal
gargantext-prelude.cabal
+18
-1
package.yaml
package.yaml
+8
-2
Machine.hs
src/Gargantext/Prelude/Crypto/Pass/Machine.hs
+3
-1
QRCode.hs
src/Gargantext/Prelude/Crypto/QRCode.hs
+27
-0
stack.yaml.lock
stack.yaml.lock
+20
-0
No files found.
gargantext-prelude.cabal
View file @
6346a3e4
...
@@ -4,7 +4,7 @@ cabal-version: 1.12
...
@@ -4,7 +4,7 @@ cabal-version: 1.12
--
--
-- see: https://github.com/sol/hpack
-- see: https://github.com/sol/hpack
--
--
-- hash:
90040862e681d50b9cbc9f20134bd721bfae96f7bb944a458e70f910a2e0a988
-- hash:
5bb5ed278614ba01df850033ab3475484d4df276a3278039a7aebf1d86dea06b
name: gargantext-prelude
name: gargantext-prelude
version: 0.1.0.0
version: 0.1.0.0
...
@@ -31,9 +31,11 @@ library
...
@@ -31,9 +31,11 @@ library
Gargantext.Prelude.Clock
Gargantext.Prelude.Clock
Gargantext.Prelude.Config
Gargantext.Prelude.Config
Gargantext.Prelude.Crypto.Auth
Gargantext.Prelude.Crypto.Auth
Gargantext.Prelude.Crypto.Encode
Gargantext.Prelude.Crypto.Hash
Gargantext.Prelude.Crypto.Hash
Gargantext.Prelude.Crypto.Pass.Machine
Gargantext.Prelude.Crypto.Pass.Machine
Gargantext.Prelude.Crypto.Pass.User
Gargantext.Prelude.Crypto.Pass.User
Gargantext.Prelude.Crypto.QRCode
Gargantext.Prelude.Crypto.Share
Gargantext.Prelude.Crypto.Share
Gargantext.Prelude.Fibonacci
Gargantext.Prelude.Fibonacci
Gargantext.Prelude.Mail
Gargantext.Prelude.Mail
...
@@ -62,10 +64,12 @@ library
...
@@ -62,10 +64,12 @@ library
, base >=4.7 && <5
, base >=4.7 && <5
, binary
, binary
, bytestring
, bytestring
, cipher-aes
, clock
, clock
, containers
, containers
, cprng-aes
, cprng-aes
, crypto-random
, crypto-random
, cryptonite
, directory
, directory
, extra
, extra
, filepath
, filepath
...
@@ -73,11 +77,14 @@ library
...
@@ -73,11 +77,14 @@ library
, ini
, ini
, lens
, lens
, located-base
, located-base
, memory
, mime-mail
, mime-mail
, mtl
, mtl
, network
, network
, password
, password
, protolude
, protolude
, qrcode-core
, qrcode-juicypixels
, random
, random
, random-shuffle
, random-shuffle
, safe
, safe
...
@@ -115,10 +122,12 @@ executable gargantext-prelude-exe
...
@@ -115,10 +122,12 @@ executable gargantext-prelude-exe
, base >=4.7 && <5
, base >=4.7 && <5
, binary
, binary
, bytestring
, bytestring
, cipher-aes
, clock
, clock
, containers
, containers
, cprng-aes
, cprng-aes
, crypto-random
, crypto-random
, cryptonite
, directory
, directory
, extra
, extra
, filepath
, filepath
...
@@ -127,11 +136,14 @@ executable gargantext-prelude-exe
...
@@ -127,11 +136,14 @@ executable gargantext-prelude-exe
, ini
, ini
, lens
, lens
, located-base
, located-base
, memory
, mime-mail
, mime-mail
, mtl
, mtl
, network
, network
, password
, password
, protolude
, protolude
, qrcode-core
, qrcode-juicypixels
, random
, random
, random-shuffle
, random-shuffle
, safe
, safe
...
@@ -170,10 +182,12 @@ test-suite gargantext-prelude-test
...
@@ -170,10 +182,12 @@ test-suite gargantext-prelude-test
, base >=4.7 && <5
, base >=4.7 && <5
, binary
, binary
, bytestring
, bytestring
, cipher-aes
, clock
, clock
, containers
, containers
, cprng-aes
, cprng-aes
, crypto-random
, crypto-random
, cryptonite
, directory
, directory
, extra
, extra
, filepath
, filepath
...
@@ -182,11 +196,14 @@ test-suite gargantext-prelude-test
...
@@ -182,11 +196,14 @@ test-suite gargantext-prelude-test
, ini
, ini
, lens
, lens
, located-base
, located-base
, memory
, mime-mail
, mime-mail
, mtl
, mtl
, network
, network
, password
, password
, protolude
, protolude
, qrcode-core
, qrcode-juicypixels
, random
, random
, random-shuffle
, random-shuffle
, safe
, safe
...
...
package.yaml
View file @
6346a3e4
...
@@ -20,14 +20,18 @@ extra-source-files:
...
@@ -20,14 +20,18 @@ extra-source-files:
description
:
Please see the README on GitHub at <https://github.com/githubuser/gargantext-prelude#readme>
description
:
Please see the README on GitHub at <https://github.com/githubuser/gargantext-prelude#readme>
dependencies
:
dependencies
:
-
MonadRandom
-
SHA
-
aeson
-
aeson
-
base >= 4.7 && < 5
-
base >= 4.7 && < 5
-
binary
-
binary
-
bytestring
-
bytestring
-
cipher-aes
-
clock
-
clock
-
containers
-
containers
-
cprng-aes
-
cprng-aes
-
crypto-random
-
crypto-random
-
cryptonite
-
directory
-
directory
-
extra
-
extra
-
filepath
-
filepath
...
@@ -35,11 +39,14 @@ dependencies:
...
@@ -35,11 +39,14 @@ dependencies:
-
ini
-
ini
-
lens
-
lens
-
located-base
-
located-base
-
memory
-
mime-mail
-
mime-mail
-
mtl
-
mtl
-
network
-
network
-
password
-
password
-
protolude
-
protolude
-
qrcode-core
-
qrcode-juicypixels
-
random
-
random
-
random-shuffle
-
random-shuffle
-
safe
-
safe
...
@@ -49,8 +56,7 @@ dependencies:
...
@@ -49,8 +56,7 @@ dependencies:
-
transformers
-
transformers
-
transformers-base
-
transformers-base
-
vector
-
vector
-
SHA
-
MonadRandom
default-extensions
:
default-extensions
:
-
DataKinds
-
DataKinds
...
...
src/Gargantext/Prelude/Crypto/Pass/Machine.hs
View file @
6346a3e4
...
@@ -14,6 +14,8 @@ https://zuttobenkyou.wordpress.com/2011/12/23/simple-password-generation-with-ha
...
@@ -14,6 +14,8 @@ https://zuttobenkyou.wordpress.com/2011/12/23/simple-password-generation-with-ha
-}
-}
{-# LANGUAGE PackageImports #-}
module
Gargantext.Prelude.Crypto.Pass.Machine
module
Gargantext.Prelude.Crypto.Pass.Machine
where
where
...
@@ -22,7 +24,7 @@ import Data.List (nub)
...
@@ -22,7 +24,7 @@ import Data.List (nub)
-- import System.Environment (getArgs)
-- import System.Environment (getArgs)
-- import System.IO (hSetEcho)
-- import System.IO (hSetEcho)
import
Control.Monad.State
import
Control.Monad.State
import
Crypto.Random
(
cprgGenerate
)
import
"crypto-random"
Crypto.Random
(
cprgGenerate
)
import
Crypto.Random.AESCtr
import
Crypto.Random.AESCtr
import
Data.Binary
(
decode
)
import
Data.Binary
(
decode
)
import
Prelude
import
Prelude
...
...
src/Gargantext/Prelude/Crypto/QRCode.hs
0 → 100644
View file @
6346a3e4
{-|
Module : Gargantext.Prelude.Crypto.Auth
Description :
Copyright : (c) CNRS, 2017-Present
License : AGPL + CECILL v3
Maintainer : team@gargantext.org
Stability : experimental
Portability : POSIX
-}
module
Gargantext.Prelude.Crypto.QRCode
where
import
Data.Maybe
import
Protolude
((
<$>
),
Int
)
import
Codec.QRCode
(
encode
,
ToText
)
import
Data.Text.Internal.Lazy
(
Text
)
import
Codec.QRCode.Data.ErrorLevel
(
ErrorLevel
(
H
))
import
Codec.QRCode.Data.QRCodeOptions
(
defaultQRCodeOptions
)
import
Codec.QRCode.JuicyPixels
import
Codec.QRCode
(
QRCodeOptions
,
TextEncoding
(
Utf8WithECI
))
qrCode
::
ToText
a
=>
Int
->
a
->
Maybe
Text
qrCode
size
a
=
toPngDataUrlT
size
size
<$>
encode
(
defaultQRCodeOptions
H
)
Utf8WithECI
a
stack.yaml.lock
0 → 100644
View file @
6346a3e4
# This file was autogenerated by Stack.
# You should not edit this file by hand.
# For more information, please see the documentation at:
# https://docs.haskellstack.org/en/stable/lock_files
packages:
- completed:
hackage: located-base-0.1.1.1@sha256:7c6395f2b6fbf2d5f76c3514f774423838c0ea94e1c6a5530dd3c94b30c9d1c8,1904
pantry-tree:
size: 534
sha256: 9d7b96ce785b464253dcf0ac2d8eb0be4cae6b96ed3960d66b81c373b540ed3f
original:
hackage: located-base-0.1.1.1@sha256:7c6395f2b6fbf2d5f76c3514f774423838c0ea94e1c6a5530dd3c94b30c9d1c8,1904
snapshots:
- completed:
size: 585392
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/18/1.yaml
sha256: 4e4c5e435a2f1c6f3c650f282db0f387f806406ed4fe6ef1aa4e6add9035d065
original:
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/18/1.yaml
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