Skip to content

Commit

Permalink
Drop hex support for now because Data.Hex looks abandoned
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan Mackie committed Jun 7, 2020
1 parent 5c61aec commit 8a1f286
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
5 changes: 2 additions & 3 deletions kesha.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cabal-version: >=1.10
build-type: Simple

name: kesha
version: 0.1.0
version: 0.2.0
synopsis: Compute the cryptographic hash of any path
description:
A Haskell library and executable for computing the cryptographic hash of any path.
Expand All @@ -19,7 +19,7 @@ extra-source-files:
README.md

tested-with:
GHC ==8.2.2 || ==8.4.4 || ==8.6.5
GHC ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.3

source-repository head
type: git
Expand All @@ -42,7 +42,6 @@ library
cryptohash-sha256,
directory >= 1.3.1,
filepath,
hex,
text

executable kesha
Expand Down
10 changes: 1 addition & 9 deletions src/Kesha.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import qualified Crypto.Hash.SHA256 as SHA256
import qualified Data.ByteString as BS
import qualified Data.ByteString.Char8 as ASCII
import qualified Data.Char as Char
import qualified Data.Hex as Hex
import qualified Data.Sequence as Seq

import Data.Bits ((.&.), (.|.), shiftL, shiftR)
Expand Down Expand Up @@ -68,16 +67,9 @@ data HashAlgo
-- Printable hash representations.
--
data HashRepr
= Hex
| Base32
= Base32

printNar :: HashAlgo -> HashRepr -> NAR.NAR -> BS.ByteString
printNar SHA256 Hex
= ASCII.map Char.toLower
. Hex.hex
. SHA256.hash
. NAR.dump

printNar SHA256 Base32
= ASCII.map Char.toLower
. printHash32 SHA256
Expand Down

0 comments on commit 8a1f286

Please sign in to comment.