base64: Fast RFC 4648-compliant Base64 encoding

[ bsd3, data, library ] [ Propose Tags ] [ Report a vulnerability ]

RFC 4648-compliant padded and unpadded base64 and base64url encoding and decoding. This library provides performant encoding and decoding primitives, as well as support for textual values.


[Skip to Readme]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.0.1.0, 0.1.0.0, 0.2.0.0, 0.3.0.0, 0.3.1.0, 0.3.1.1, 0.4.0, 0.4.1, 0.4.2, 0.4.2.1, 0.4.2.2, 0.4.2.3, 0.4.2.4, 1.0 (info)
Change log CHANGELOG.md
Dependencies base (>=4.10 && <5), bytestring (>=0.10 && <0.11), text (>=1.2 && <1.3) [details]
Tested with ghc ==8.8.1 || ==8.6.5 || ==8.6.3 || ==8.4.4 || ==8.4.3 || ==8.2.2
License BSD-3-Clause
Copyright (c) 2019-2020 Emily Pillmore
Author Emily Pillmore
Maintainer emilypi@cohomolo.gy
Revised Revision 1 made by topos at 2020-02-05T02:31:32Z
Category Data
Home page https://github.com/emilypi/base64
Bug tracker https://github.com/emilypi/base64/issues
Source repo head: git clone https://github.com/emilypi/base64.git
Uploaded by topos at 2020-02-05T02:29:47Z
Distributions Arch:0.4.2.4, Fedora:0.4.2.4, LTSHaskell:0.4.2.4, NixOS:0.4.2.4, Stackage:1.0
Reverse Dependencies 29 direct, 203 indirect [details]
Downloads 19987 total (289 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2020-02-05 [all 1 reports]

Readme for base64-0.4.1

[back to package description]

Base64

Build Status Hackage

Padded and unpadded base64 and base64url encoding and decoding for Text and ByteString values.

For the companion optics and pattern synonyms, see base64-lens.

Summary

What does this library provide? Here is the summary:

  • Good performance compared to existing Base64 libraries (see PERFORMANCE.md)
  • Support for padded and unpadded Base64 and Base64url
  • Support for Text encodings and decodings
  • Optics for handling more complex structures with Base64 representations via the base64-lens package
  • Checks for both valid Base64 and correct Base64 and Base64url encodings

There are no dependencies aside from those bundled with GHC:

base64 dependencies

Motivation

Haskell has two main libraries for Base64: memory, and base64-bytestring.

Of these, memory is geared towards integration with other memory primitives in the library, without much of an eye towards performance, while base64-bytestring is built to exclusively address ByteString encoding and decoding, and is very performant. Many great strides have been made in the realm of Base64 performance and vectorization just in the past 5 years, which this library attempts to capture. Additionally, we attempt to fix perceived shortcomings with both APIs in the support of unpadded Base64 and Base64-url support (which memory provides, but not base64-bytestring), as well as supporting Text values (neither libraries provide).