roc/crates/cli/tests/benchmarks/testBase64.roc
2025-01-04 15:10:55 -08:00

15 lines
473 B
Text

app [main!] { pf: platform "platform/main.roc" }
import Base64
import pf.Host
main! : {} => {}
main! = \{} ->
when Base64.from_bytes(Str.toUtf8("Hello World")) is
Err(_) -> Host.put_line!("sadness")
Ok(encoded) ->
Host.put_line!(Str.concat("encoded: ", encoded))
when Base64.to_str(encoded) is
Ok(decoded) -> Host.put_line!(Str.concat("decoded: ", decoded))
Err(_) -> Host.put_line!("sadness")