diff options
| author | Albert Krewinkel <[email protected]> | 2024-09-29 18:32:12 +0200 |
|---|---|---|
| committer | Albert Krewinkel <[email protected]> | 2024-09-29 18:36:56 +0200 |
| commit | 7565a90cec79c5fcd1d3b3e5ddb042d2cdaccac3 (patch) | |
| tree | f48f1ff5d8c87092990c97ff4b9aa068501304c7 /pandoc-lua-engine | |
| parent | 7a96b253c205a1cf5dad862a46e29f0183d36cc7 (diff) | |
Stop depending on package SHA
Pandoc already depends on `crypton-conntection`, and thus transitively
on `crypton`. The latter provides a vast variety of hashing algorithms
and makes the dependency on SHA unnecessary.
Diffstat (limited to 'pandoc-lua-engine')
| -rw-r--r-- | pandoc-lua-engine/pandoc-lua-engine.cabal | 4 | ||||
| -rw-r--r-- | pandoc-lua-engine/src/Text/Pandoc/Lua/Module/Utils.hs | 7 |
2 files changed, 5 insertions, 6 deletions
diff --git a/pandoc-lua-engine/pandoc-lua-engine.cabal b/pandoc-lua-engine/pandoc-lua-engine.cabal index 93ca4c935..a9ff59186 100644 --- a/pandoc-lua-engine/pandoc-lua-engine.cabal +++ b/pandoc-lua-engine/pandoc-lua-engine.cabal @@ -105,9 +105,9 @@ library , Text.Pandoc.Lua.Writer.Classic , Text.Pandoc.Lua.Writer.Scaffolding - build-depends: SHA >= 1.6 && < 1.7 - , aeson + build-depends: aeson , bytestring >= 0.9 && < 0.13 + , crypton >= 0.30 && < 1.1 , citeproc >= 0.8 && < 0.9 , containers >= 0.6.0.1 && < 0.8 , data-default >= 0.4 && < 0.8 diff --git a/pandoc-lua-engine/src/Text/Pandoc/Lua/Module/Utils.hs b/pandoc-lua-engine/src/Text/Pandoc/Lua/Module/Utils.hs index 8bd04b72b..325f09258 100644 --- a/pandoc-lua-engine/src/Text/Pandoc/Lua/Module/Utils.hs +++ b/pandoc-lua-engine/src/Text/Pandoc/Lua/Module/Utils.hs @@ -19,6 +19,7 @@ module Text.Pandoc.Lua.Module.Utils import Control.Applicative ((<|>)) import Control.Monad ((<$!>)) +import Crypto.Hash (hashWith, SHA1(SHA1)) import Data.Data (showConstr, toConstr) import Data.Default (def) import Data.Maybe (fromMaybe) @@ -34,8 +35,6 @@ import Text.Pandoc.Lua.Marshal.AST import Text.Pandoc.Lua.Marshal.Reference import Text.Pandoc.Lua.PandocLua (PandocLua (unPandocLua)) -import qualified Data.Digest.Pure.SHA as SHA -import qualified Data.ByteString.Lazy as BSL import qualified Data.Map as Map import qualified Data.Text as T import qualified Text.Pandoc.Builder as B @@ -301,8 +300,8 @@ run_json_filter = defun "run_json_filter" -- | Documented Lua function to compute the hash of a string. sha1 :: DocumentedFunction e sha1 = defun "sha1" - ### liftPure (SHA.showDigest . SHA.sha1) - <#> parameter (fmap BSL.fromStrict . peekByteString) "string" "input" "" + ### liftPure (show . hashWith SHA1) + <#> parameter peekByteString "string" "input" "" =#> functionResult pushString "string" "hexadecimal hash value" #? "Computes the SHA1 hash of the given string input." |
