File tree Expand file tree Collapse file tree 2 files changed +1
-12
lines changed Expand file tree Collapse file tree 2 files changed +1
-12
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ library
7979 base >= 4.12 && < 5
8080 , attoparsec
8181 , algebraic-graphs >= 0.5 && < 0.8
82- , base16-bytestring
82+ , base16-bytestring >= 1.0
8383 , base64-bytestring
8484 , bytestring
8585 , case-insensitive
Original file line number Diff line number Diff line change 1- {-# LANGUAGE CPP #-}
2-
31module System.Nix.Base
42 ( BaseEncoding (Base16 ,NixBase32 ,Base64 )
53 , encodeWith
@@ -36,18 +34,9 @@ encodeWith Base64 =
3634
3735-- | Take the input & @Base@ encoding witness -> decode into @Text@.
3836decodeWith :: BaseEncoding -> Text -> Either String ByteString
39- #if MIN_VERSION_base16_bytestring(1,0,0)
4037decodeWith Base16 =
4138 Data.ByteString.Base16. decode
4239 . Data.Text.Encoding. encodeUtf8
43- #else
44- decodeWith Base16 = lDecode -- this tacit sugar simply makes GHC pleased with number of args
45- where
46- lDecode t =
47- case Data.ByteString.Base16. decode (Data.Text.Encoding. encodeUtf8 t) of
48- (x, " " ) -> pure $ x
49- _ -> Left $ " Unable to decode base16 string" <> toString t
50- #endif
5140decodeWith NixBase32 = System.Nix.Base32. decode
5241decodeWith Base64 =
5342 Data.ByteString.Base64. decode
You can’t perform that action at this time.
0 commit comments