base32 0.1.1 → 0.1.1.1
raw patch · 6 files changed
+40/−21 lines, 6 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +8/−0
- base32.cabal +1/−1
- src/Data/ByteString/Base32.hs +10/−6
- src/Data/ByteString/Base32/Hex.hs +9/−6
- src/Data/Text/Encoding/Base32.hs +6/−4
- src/Data/Text/Encoding/Base32/Hex.hs +6/−4
CHANGELOG.md view
@@ -1,5 +1,13 @@ # Revision history for base32 +## 0.1.1.1 -- 2020-02-16++* Documentation now references correct RFC section++## 0.1.1 -- 2020-02-16++* Textual interface now uses correct unpadded version+ ## 0.1.0.0 -- 2020-02-16 * First version. Released on an unsuspecting world.
base32.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.0 name: base32-version: 0.1.1+version: 0.1.1.1 synopsis: RFC 4648-compliant Base32 encodings/decodings description: RFC 4648-compliant Base32 encodings and decodings.
src/Data/ByteString/Base32.hs view
@@ -38,7 +38,7 @@ -- | Encode a 'ByteString' value as Base32 'Text' with padding. ----- See: <https://tools.ietf.org/html/rfc4648#section-4 RFC-4648 section 4>+-- See: <https://tools.ietf.org/html/rfc4648#section-6 RFC-4648 section 6> -- encodeBase32 :: ByteString -> Text encodeBase32 = T.decodeUtf8 . encodeBase32'@@ -46,7 +46,7 @@ -- | Encode a 'ByteString' value as a Base32 'ByteString' value with padding. ----- See: <https://tools.ietf.org/html/rfc4648#section-4 RFC-4648 section 4>+-- See: <https://tools.ietf.org/html/rfc4648#section-6 RFC-4648 section 6> -- encodeBase32' :: ByteString -> ByteString encodeBase32' = encodeBase32_ "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"#@@ -54,7 +54,7 @@ -- | Decode a padded Base32-encoded 'ByteString' value. ----- See: <https://tools.ietf.org/html/rfc4648#section-4 RFC-4648 section 4>+-- See: <https://tools.ietf.org/html/rfc4648#section-6 RFC-4648 section 6> -- decodeBase32 :: ByteString -> Either Text ByteString decodeBase32 = decodeBase32_ False stdDecodeTable@@ -62,15 +62,18 @@ -- | Encode a 'ByteString' value as a Base32 'Text' value without padding. ----- See: <https://tools.ietf.org/html/rfc4648#section-4 RFC-4648 section 4>+-- See: <https://tools.ietf.org/html/rfc4648#section-6 RFC-4648 section 6>,+-- <https://tools.ietf.org/html/rfc4648#section-3.2 RFC-4648 section 3.2> --+-- encodeBase32Unpadded :: ByteString -> Text encodeBase32Unpadded = T.decodeUtf8 . encodeBase32Unpadded' {-# INLINE encodeBase32Unpadded #-} -- | Encode a 'ByteString' value as a Base32 'ByteString' value with padding. ----- See: <https://tools.ietf.org/html/rfc4648#section-4 RFC-4648 section 4>+-- See: <https://tools.ietf.org/html/rfc4648#section-6 RFC-4648 section 6>,+-- <https://tools.ietf.org/html/rfc4648#section-3.2 RFC-4648 section 3.2> -- encodeBase32Unpadded' :: ByteString -> ByteString encodeBase32Unpadded' = encodeBase32NoPad_ "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"#@@ -78,7 +81,8 @@ -- | Decode an arbitarily padded Base32-encoded 'ByteString' value. ----- See: <https://tools.ietf.org/html/rfc4648#section-4 RFC-4648 section 4>+-- See: <https://tools.ietf.org/html/rfc4648#section-6 RFC-4648 section 6>,+-- <https://tools.ietf.org/html/rfc4648#section-3.2 RFC-4648 section 3.2> -- decodeBase32Unpadded :: ByteString -> Either Text ByteString decodeBase32Unpadded = decodeBase32_ True stdDecodeTable
src/Data/ByteString/Base32/Hex.hs view
@@ -37,7 +37,7 @@ -- | Encode a 'ByteString' value as a Base32hex 'Text' value with padding. ----- See: <https://tools.ietf.org/html/rfc4648#section-5 RFC-4648 section 5>+-- See: <https://tools.ietf.org/html/rfc4648#section-7 RFC-4648 section 7> -- encodeBase32 :: ByteString -> Text encodeBase32 = T.decodeUtf8 . encodeBase32'@@ -45,7 +45,7 @@ -- | Encode a 'ByteString' as a Base32hex 'ByteString' value with padding. ----- See: <https://tools.ietf.org/html/rfc4648#section-5 RFC-4648 section 5>+-- See: <https://tools.ietf.org/html/rfc4648#section-7 RFC-4648 section 7> -- encodeBase32' :: ByteString -> ByteString encodeBase32' = encodeBase32_ "0123456789ABCDEFGHIJKLMNOPQRSTUV"#@@ -53,7 +53,7 @@ -- | Decode a padded Base32hex encoded 'ByteString' value. ----- See: <https://tools.ietf.org/html/rfc4648#section-4 RFC-4648 section 4>+-- See: <https://tools.ietf.org/html/rfc4648#section-7 RFC-4648 section 7> -- decodeBase32 :: ByteString -> Either Text ByteString decodeBase32 = decodeBase32_ False hexDecodeTable@@ -61,7 +61,8 @@ -- | Encode a 'ByteString' as a Base32hex 'Text' value without padding. ----- See: <https://tools.ietf.org/html/rfc4648#section-5 RFC-4648 section 5>+-- See: <https://tools.ietf.org/html/rfc4648#section-7 RFC-4648 section 7>,+-- <https://tools.ietf.org/html/rfc4648#section-3.2 RFC-4648 section 3.2> -- encodeBase32Unpadded :: ByteString -> Text encodeBase32Unpadded = T.decodeUtf8 . encodeBase32Unpadded'@@ -69,7 +70,8 @@ -- | Encode a 'ByteString' as a Base32hex 'ByteString' value without padding. ----- See: <https://tools.ietf.org/html/rfc4648#section-5 RFC-4648 section 5>+-- See: <https://tools.ietf.org/html/rfc4648#section-7 RFC-4648 section 7>,+-- <https://tools.ietf.org/html/rfc4648#section-3.2 RFC-4648 section 3.2> -- encodeBase32Unpadded' :: ByteString -> ByteString encodeBase32Unpadded' = encodeBase32NoPad_ "0123456789ABCDEFGHIJKLMNOPQRSTUV"#@@ -77,7 +79,8 @@ -- | Decode an arbitrarily padded Base32hex encoded 'ByteString' value. ----- See: <https://tools.ietf.org/html/rfc4648#section-4 RFC-4648 section 4>+-- See: <https://tools.ietf.org/html/rfc4648#section-7 RFC-4648 section 7>,+-- <https://tools.ietf.org/html/rfc4648#section-3.2 RFC-4648 section 3.2> -- decodeBase32Unpadded :: ByteString -> Either Text ByteString decodeBase32Unpadded = decodeBase32_ True hexDecodeTable
src/Data/Text/Encoding/Base32.hs view
@@ -30,7 +30,7 @@ -- | Encode a 'Text' value in Base32 with padding. ----- See: <https://tools.ietf.org/html/rfc4648#section-4 RFC-4648 section 4>+-- See: <https://tools.ietf.org/html/rfc4648#section-6 RFC-4648 section 6> -- encodeBase32 :: Text -> Text encodeBase32 = B32.encodeBase32 . T.encodeUtf8@@ -38,7 +38,7 @@ -- | Decode a padded Base32-encoded 'Text' value ----- See: <https://tools.ietf.org/html/rfc4648#section-4 RFC-4648 section 4>+-- See: <https://tools.ietf.org/html/rfc4648#section-6 RFC-4648 section 6> -- decodeBase32 :: Text -> Either Text Text decodeBase32 = fmap T.decodeUtf8 . B32.decodeBase32 . T.encodeUtf8@@ -46,7 +46,8 @@ -- | Encode a 'Text' value in Base32 without padding. ----- See: <https://tools.ietf.org/html/rfc4648#section-4 RFC-4648 section 4>+-- See: <https://tools.ietf.org/html/rfc4648#section-6 RFC-4648 section 6>,+-- <https://tools.ietf.org/html/rfc4648#section-3.2 RFC-4648 section 3.2> -- encodeBase32Unpadded :: Text -> Text encodeBase32Unpadded = B32.encodeBase32Unpadded . T.encodeUtf8@@ -54,7 +55,8 @@ -- | Decode an arbitrarily padded Base32-encoded 'Text' ----- See: <https://tools.ietf.org/html/rfc4648#section-3.2 RFC-4648 section 3.2>+-- See: <https://tools.ietf.org/html/rfc4648#section-6 RFC-4648 section 6>,+-- <https://tools.ietf.org/html/rfc4648#section-3.2 RFC-4648 section 3.2> -- decodeBase32Unpadded :: Text -> Either Text Text decodeBase32Unpadded = fmap T.decodeUtf8
src/Data/Text/Encoding/Base32/Hex.hs view
@@ -29,7 +29,7 @@ -- | Encode a 'Text' value in Base32hex with padding. ----- See: <https://tools.ietf.org/html/rfc4648#section-5 RFC-4648 section 5>+-- See: <https://tools.ietf.org/html/rfc4648#section-7 RFC-4648 section 7> -- encodeBase32 :: Text -> Text encodeBase32 = B32U.encodeBase32 . T.encodeUtf8@@ -37,7 +37,7 @@ -- | Decode a padded Base32hex-encoded 'Text' value. ----- See: <https://tools.ietf.org/html/rfc4648#section-4 RFC-4648 section 4>+-- See: <https://tools.ietf.org/html/rfc4648#section-7 RFC-4648 section 7> -- decodeBase32 :: Text -> Either Text Text decodeBase32 = fmap T.decodeUtf8 . B32U.decodeBase32 . T.encodeUtf8@@ -45,7 +45,8 @@ -- | Encode a 'Text' value in Base32hex without padding. ----- See: <https://tools.ietf.org/html/rfc4648#section-3.2 RFC-4648 section 3.2>+-- See: <https://tools.ietf.org/html/rfc4648#section-7 RFC-4648 section 7>,+-- <https://tools.ietf.org/html/rfc4648#section-3.2 RFC-4648 section 3.2> -- encodeBase32Unpadded :: Text -> Text encodeBase32Unpadded = B32U.encodeBase32Unpadded . T.encodeUtf8@@ -53,7 +54,8 @@ -- | Decode an arbitrarily padded Base32hex encoded 'Text' value ----- See: <https://tools.ietf.org/html/rfc4648#section-4 RFC-4648 section 4>+-- See: <https://tools.ietf.org/html/rfc4648#section-7 RFC-4648 section 7>,+-- <https://tools.ietf.org/html/rfc4648#section-3.2 RFC-4648 section 3.2> -- decodeBase32Unpadded :: Text -> Either Text Text decodeBase32Unpadded = fmap T.decodeUtf8