truqu/elm-base64/2.0.0

NOTE: this package is not compatible with Elm 0.19.1

Base64

Library for base64 encoding and decoding.

Decodes UTF-16 into UTF-8 for encoding, and decodes UTF-8 into UTF-16 for encoding.

encode "👍"
--> "8J+RjQ=="


decode "8J+RjQ=="
--> Ok "👍"
encode : String -> String

Encodes any Elm string into Base64.

decode : String -> Result String String

Decodes Base64 into Elm strings.

This can result in an Err "Invalid base64" if the input is not valid base64. If the resulting string cannot be converted to UTF-16, this will result in an Err "Invalid UTF-16".