Base64.Decode
Decode Base64 strings.
Decoders
string :
String -> Result Error String
Decode a Base64 string as String
.
bytes :
String -> Result Error Bytes
Decode a Base64 string as Bytes
.
type Error
= InvalidCharacter Char
| IncorrectPadding
| InvalidLength
| BytesToStringError
The errors that can happen when decoding a Base64 string.
InvalidCharacter
happens when encountering an invalid character in the passed Base64 string.IncorrectPadding
happens when the Base64 string has padding (the=
character) anywhere other than the the last two characters.InvalidLength
happens when the Base64 string is an invalid lengthBytesToStringError
happens only when using thestring
function in this module and there is a problem converting the decodedBytes
into aString
.