This package can convert bytes to Base64 strings and vice versa.
Encode a string into a Base64 string.
This function is a wrapper around fromBytes.
Similarly, it should never return Nothing, but alas, Bytes.Decode.decode,
which fromBytes uses, returns a Maybe String.
Convert a Base64 string to bytes.
If you want more control over the process, you should use encoder.
This function fails (returns Nothing) if you give it an invalid Base64 sequence.
Decode a Base64 string into a string.
This function is a wrapper around toBytes.
It will fail (return Nothing) if you give it an invalid Base64 sequence.
encoder returns a bytes encoder. It fails if the string that is passed
to it is not a valid Base64 sequence.
It's used in toBytes:
toBytes : String -> Maybe Bytes
toBytes string =
Maybe.map Bytes.Encode.encode (encoder string)
Convert bytes to a Base64 string. If you want more control over the process, you should use
decoder.This function should never return
Nothing, but it usesBytes.Decode.decode, which returns aMaybe String.