base64: A modern RFC 4648-compliant Base64 library

[ bsd3, data, library ] [ Propose Tags ]

RFC 4648-compliant Base64 with an eye towards performance and modernity (support for RFC 7049 idioms for Base64url).

[Skip to Readme]


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


Versions [RSS],,,,,, 0.4.0, 0.4.1, 0.4.2,,,,, 1.0 (info)
Change log
Dependencies base (>=4.10 && <4.16), bytestring (>=0.10 && <0.12), ghc-byteorder (>= && <4.12), text (>=1.2 && <1.3), text-short (>=0.1 && <0.2) [details]
License BSD-3-Clause
Copyright (c) 2019-2020 Emily Pillmore
Author Emily Pillmore
Revised Revision 5 made by Bodigrim at 2023-01-28T19:33:27Z
Category Data
Home page
Bug tracker
Source repo head: git clone
Uploaded by topos at 2020-05-19T00:20:17Z
Distributions Arch:, Fedora:, LTSHaskell:, NixOS:, Stackage:1.0, openSUSE:
Reverse Dependencies 28 direct, 198 indirect [details]
Downloads 18082 total (255 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-05-19 [all 1 reports]

Readme for base64-0.4.2

[back to package description]


Build Status Hackage

Base64 encoding and decodings.

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


The following types are supported for both std, padded url-safe, and unpadded url-safe alphabets:

  • Data.ByteString
  • Data.ByteString.Lazy
  • Data.ByteString.Short
  • Data.Text
  • Data.Text.Lazy
  • Data.Text.Short

Additionally this library has

  • Better performance than base64-bytestring for encode and decode.
  • Optics for handling more complex structures with Base64 representations via the base64-lens package
  • Checks for both validity and correctness of Base64 and Base64url encodings

There are no dependencies aside from those bundled with GHC, and the ultra-minimal ghc-byteorder.