base64-bytestring-type-1.0.1: A newtype around ByteString, for base64 encoding
Safe Haskell None
Language Haskell2010

Data.ByteString.Base64.Lazy.Type

Description

Lazy ByteString standard base64 encoding.

See https://tools.ietf.org/html/rfc4648 .

Synopsis

Documentation

data ByteString64 Source #

Aeson serialisable bytestring. Uses base64 encoding.

The inner ByteString is in raw format.

>>> let bs64 = makeByteString64 "foobar"
>>> bs64
mkBS64 "foobar"

Binary instance doesn't use base64 encoding:

>>> Binary.encode bs64
"\NUL\NUL\NUL\NUL\NUL\NUL\NUL\ACKfoobar"

Aeson instance does:

>>> Aeson.encode bs64
"\"Zm9vYmFy\""

This module uses standard alphabet

>>> Aeson.encode (makeByteString64 "aa\191")
"\"YWG/\""

Instances

Instances details
Eq ByteString64 Source #
Instance details

Defined in Data.ByteString.Base64.Lazy.Type

Data ByteString64 Source #
Instance details

Defined in Data.ByteString.Base64.Lazy.Type

Methods

gfoldl :: ( forall d b. Data d => c (d -> b) -> d -> c b) -> ( forall g. g -> c g) -> ByteString64 -> c ByteString64 Source #

gunfold :: ( forall b r. Data b => c (b -> r) -> c r) -> ( forall r. r -> c r) -> Constr -> c ByteString64 Source #

toConstr :: ByteString64 -> Constr Source #

dataTypeOf :: ByteString64 -> DataType Source #

dataCast1 :: Typeable t => ( forall d. Data d => c (t d)) -> Maybe (c ByteString64 ) Source #

dataCast2 :: Typeable t => ( forall d e. ( Data d, Data e) => c (t d e)) -> Maybe (c ByteString64 ) Source #

gmapT :: ( forall b. Data b => b -> b) -> ByteString64 -> ByteString64 Source #

gmapQl :: (r -> r' -> r) -> r -> ( forall d. Data d => d -> r') -> ByteString64 -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> ( forall d. Data d => d -> r') -> ByteString64 -> r Source #

gmapQ :: ( forall d. Data d => d -> u) -> ByteString64 -> [u] Source #

gmapQi :: Int -> ( forall d. Data d => d -> u) -> ByteString64 -> u Source #

gmapM :: Monad m => ( forall d. Data d => d -> m d) -> ByteString64 -> m ByteString64 Source #

gmapMp :: MonadPlus m => ( forall d. Data d => d -> m d) -> ByteString64 -> m ByteString64 Source #

gmapMo :: MonadPlus m => ( forall d. Data d => d -> m d) -> ByteString64 -> m ByteString64 Source #

Ord ByteString64 Source #
Instance details

Defined in Data.ByteString.Base64.Lazy.Type

Show ByteString64 Source #
Instance details

Defined in Data.ByteString.Base64.Lazy.Type

IsString ByteString64 Source #
Instance details

Defined in Data.ByteString.Base64.Lazy.Type

Generic ByteString64 Source #
Instance details

Defined in Data.ByteString.Base64.Lazy.Type

Semigroup ByteString64 Source #
Instance details

Defined in Data.ByteString.Base64.Lazy.Type

Monoid ByteString64 Source #
Instance details

Defined in Data.ByteString.Base64.Lazy.Type

Function ByteString64 Source #
Instance details

Defined in Data.ByteString.Base64.Lazy.Type

Arbitrary ByteString64 Source #
Instance details

Defined in Data.ByteString.Base64.Lazy.Type

CoArbitrary ByteString64 Source #
Instance details

Defined in Data.ByteString.Base64.Lazy.Type

Hashable ByteString64 Source #
Instance details

Defined in Data.ByteString.Base64.Lazy.Type

ToJSON ByteString64 Source #
Instance details

Defined in Data.ByteString.Base64.Lazy.Type

ToJSONKey ByteString64 Source #
Instance details

Defined in Data.ByteString.Base64.Lazy.Type

FromJSON ByteString64 Source #
Instance details

Defined in Data.ByteString.Base64.Lazy.Type

FromJSONKey ByteString64 Source #
Instance details

Defined in Data.ByteString.Base64.Lazy.Type

Binary ByteString64 Source #

ByteString64 is serialised as ByteString

>>> Binary.encode (mkBS64 "foobar")
"\NUL\NUL\NUL\NUL\NUL\NUL\NUL\ACKfoobar"
Instance details

Defined in Data.ByteString.Base64.Lazy.Type

Serialize ByteString64 Source #

ByteString64 is serialised as ByteString

>>> Cereal.encode (mkBS64 "foobar")
"\NUL\NUL\NUL\NUL\NUL\NUL\NUL\ACKfoobar"
Instance details

Defined in Data.ByteString.Base64.Lazy.Type

NFData ByteString64 Source #
Instance details

Defined in Data.ByteString.Base64.Lazy.Type

Serialise ByteString64 Source #
>>> Serialise.serialise (mkBS64 "xyzzy")
"_Exyzzy\255"
Instance details

Defined in Data.ByteString.Base64.Lazy.Type

type Rep ByteString64 Source #
Instance details

Defined in Data.ByteString.Base64.Lazy.Type

type Rep ByteString64 = D1 (' MetaData "ByteString64" "Data.ByteString.Base64.Lazy.Type" "base64-bytestring-type-1.0.1-79EWs4GzwM7By4hPpYj75d" ' True ) ( C1 (' MetaCons "BS64" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ByteString )))

getEncodedByteString64 :: ByteString64 -> ByteString Source #

Get base64 encode bytestring

>>> getEncodedByteString64 "foobar"
"Zm9vYmFy"
>>> getEncodedByteString64 "aa\191"
"YWG/"