Skip to content

An encoder and decoder of Base64, Base32, and Base16 for Elm

License

Notifications You must be signed in to change notification settings

waratuman/elm-coder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Elm Coder

An encoder and decoder for Base64, Base32 and Base16 (Hexadecimal).

Example

import Base32 exposing (decode, encode)


encodeFooBar =
    ("foobar"
        |> String.toList
        |> List.map Char.toCode
        |> encode
    )
        == Ok "Zm9vYmFy"


decodeFooBar =
    ("Zm9vYmFy"
        |> decode
        |> Result.map (List.map Char.fromCode >> String.fromList)
    )
        == Ok "foobar"