memory-0.13: memory and related abstraction stuff

License | BSD-style
Maintainer | Vincent Hanquez <vincent@snarc.org>
Stability | experimental
Portability | unknown
Safe Haskell | None
Language | Haskell2010

Data.ByteArray.Encoding

Description

ByteArray base converting

Synopsis

- convertToBase :: (ByteArrayAccess bin, ByteArray bout) => Base -> bin -> bout
- convertFromBase :: (ByteArrayAccess bin, ByteArray bout) => Base -> bin -> Either String bout
- data Base
  - = Base16
  - | Base32
  - | Base64
  - | Base64URLUnpadded
  - | Base64OpenBSD

# Documentation

convertToBase :: (ByteArrayAccess bin, ByteArray bout) => Base -> bin -> bout #

Convert a bytearray to the equivalent representation in a specific Base

convertFromBase :: (ByteArrayAccess bin, ByteArray bout) => Base -> bin -> Either String bout #

Try to Convert a bytearray from the equivalent representation in a specific Base

data Base #

Different bases that can be used

See RFC4648 for details. In particular, Base64 can be standard or URL-safe. URL-safe encoding is often used in other specifications without padding characters.

Constructors

Base16 | similar to hexadecimal
Base32 |
Base64 | standard Base64
Base64URLUnpadded | unpadded URL-safe Base64
Base64OpenBSD | Base64 as used in OpenBSD password encoding (such as bcrypt)

Instances

Eq Base # |
Methods (==) :: Base -> Base -> Bool # (/=) :: Base -> Base -> Bool #
Show Base # |
Methods showsPrec :: Int -> Base -> ShowS # show :: Base -> String # showList :: [Base] -> ShowS #