base64-bytestring 1.0.0.2 → 1.0.0.3
raw patch · 7 files changed
+30/−5 lines, 7 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +9/−0
- Data/ByteString/Base64.hs +5/−0
- Data/ByteString/Base64/Internal.hs +1/−1
- Data/ByteString/Base64/Lazy.hs +2/−1
- Data/ByteString/Base64/URL/Lazy.hs +1/−0
- base64-bytestring.cabal +1/−1
- benchmarks/BM.hs +11/−2
CHANGELOG.md view
@@ -1,3 +1,12 @@+# 1.0.0.3++* Made performance more robust + ([#27](https://github.com/haskell/base64-bytestring/pull/27)).+* Improved documentation+ ([#23](https://github.com/haskell/base64-bytestring/pull/23)).+* Improved the performance of decodeLenient a bit+ ([#21](https://github.com/haskell/base64-bytestring/pull/21)).+ # 1.0.0.2 * Fixed a write past allocated memory in joinWith (potential security
Data/ByteString/Base64.hs view
@@ -36,6 +36,11 @@ -- | Decode a base64-encoded string. This function strictly follows -- the specification in -- <http://tools.ietf.org/rfc/rfc4648 RFC 4648>.+--+-- (Note: this means that even @"\n", "\r\n"@ as line breaks are rejected+-- rather than ignored. If you are using this in the context of a+-- standard that overrules RFC 4648 such as HTTP multipart mime bodies,+-- consider using 'decodeLenient'.) decode :: ByteString -> Either String ByteString decode s = decodeWithTable decodeFP s
Data/ByteString/Base64/Internal.hs view
@@ -91,7 +91,7 @@ fill (castPtr dptr) (sptr `plusPtr` soff) return $! PS dfp 0 dlen -data EncodeTable = ET (ForeignPtr Word8) (ForeignPtr Word16)+data EncodeTable = ET !(ForeignPtr Word8) !(ForeignPtr Word16) -- The encoding table is constructed such that the expansion of a 12-bit -- block to a 16-bit block can be done by a single Word16 copy from the
Data/ByteString/Base64/Lazy.hs view
@@ -57,4 +57,5 @@ . LC.filter goodChar where -- We filter out and '=' padding here, but B64.decodeLenient -- handles that- goodChar c = isAlphaNum c || c == '+' || c == '/'+ goodChar c = isDigit c || isAsciiUpper c || isAsciiLower c+ || c == '+' || c == '/'
Data/ByteString/Base64/URL/Lazy.hs view
@@ -58,3 +58,4 @@ where -- We filter out and '=' padding here, but B64.decodeLenient -- handles that goodChar c = isAlphaNum c || c == '-' || c == '_'+
base64-bytestring.cabal view
@@ -1,5 +1,5 @@ name: base64-bytestring-version: 1.0.0.2+version: 1.0.0.3 synopsis: Fast base64 encoding and decoding for ByteStrings description: This package provides support for encoding and decoding binary data according to @base64@ (see also <https://tools.ietf.org/html/rfc4648 RFC 4648>) for strict and lazy ByteStrings. homepage: https://github.com/haskell/base64-bytestring
benchmarks/BM.hs view
@@ -5,6 +5,7 @@ import qualified Data.ByteString.Base64 as B import qualified Data.ByteString.Base64.Lazy as L import qualified Data.ByteString.Base64.URL as U+import qualified Data.ByteString.Base64.URL.Lazy as LU import qualified Data.ByteString.Char8 as B import qualified Data.ByteString.Lazy as L @@ -38,8 +39,16 @@ lazy :: String -> L.ByteString -> Benchmark lazy name orig = bgroup name [- bench "decode" $ nf L.decode enc- , bench "encode" $ nf L.encode orig+ bgroup "normal" [+ bench "decode" $ nf L.decode enc+ , bench "decodeLenient" $ nf L.decodeLenient enc+ , bench "encode" $ nf L.encode orig+ ]+ , bgroup "url" [+ bench "decode" $ nf LU.decode enc+ , bench "decodeLenient" $ nf LU.decodeLenient enc+ , bench "encode" $ nf LU.encode orig+ ] ] where enc = L.encode orig