base32

Fast RFC 4648-compliant Base32 encoding

https://github.com/emilypi/base32

Version on this page:0.2.1.0@rev:1
LTS Haskell 22.43:0.4@rev:1
Stackage Nightly 2024-11-30:0.4@rev:1
Latest on Hackage:0.4@rev:1

See all snapshots base32 appears in

BSD-3-Clause licensed by Emily Pillmore
Maintained by [email protected]
This version can be pinned in stack with:base32-0.2.1.0@sha256:0033e0f53093befbc3f1e85bd431f1767055da7969a5d58b36215b4d2dbcfe2a,2740

Base32

Build Status Hackage

Padded and unpadded base32 and base32hex encoding and decoding for Text and ByteString values.

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

Summary

The following types are supported for both padded and unpadded std and extended hex alphabets:

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

Additionally this library has

  • Better performance than memory for encode and decode 3-4x.
  • Optics for handling more complex structures with Base32 representations via the base32-lens package
  • Checks for both validity and correctness of Base32 and Base32hex encodings

There are no dependencies aside from those bundled with GHC, text-short, and the ghc-byteorder re-export.

Changes

Revision history for base32

0.2.1.0

  • Expose Data.ByteString.Base32.Internal API
  • Use closed-form encoding/decoding length calculations, reducing branching and improving performance
  • Update tests:
    • Migrate to using lower heap-footprint concrete dict passing
    • Support for 8.10.5 testing

0.2.0.0

  • Bugfix: fix unpadded base32 encoding (#4)
  • Bugfix: Use decodeLatin1 when decoding, defer to decodeWith* primitives for finer-grained Text to ByteString conversions. (#5)
  • Add short and lazy variants for Text and ByteString (#6)
  • Expanded test coverage to 96% (#7)
  • Improved performance and better error reporting in final quanta (#9)
  • Improved docs + trustworthy/safe annotations (#10)

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.