008 base64

✓ Passing This code compiles and runs correctly.

Code

input.k

Actual

encode  ->  (rfc: )
encode f -> Zg== (rfc: Zg==)
encode fo -> Zm8= (rfc: Zm8=)
encode foo -> Zm9v (rfc: Zm9v)
encode foob -> Zm9vYg== (rfc: Zm9vYg==)
encode fooba -> Zm9vYmE= (rfc: Zm9vYmE=)
encode foobar -> Zm9vYmFy (rfc: Zm9vYmFy)
decode Zg== -> f (want: f)
decode Zm8= -> fo (want: fo)
decode Zm9v -> foo (want: foo)
decode Zm9vYg== -> foob (want: foob)
decode Zm9vYmE= -> fooba (want: fooba)
decode Zm9vYmFy -> foobar (want: foobar)
roundtrip MATCH: The quick brown fox jumps over the lazy dog.

Expected output

encode  ->  (rfc: )
encode f -> Zg== (rfc: Zg==)
encode fo -> Zm8= (rfc: Zm8=)
encode foo -> Zm9v (rfc: Zm9v)
encode foob -> Zm9vYg== (rfc: Zm9vYg==)
encode fooba -> Zm9vYmE= (rfc: Zm9vYmE=)
encode foobar -> Zm9vYmFy (rfc: Zm9vYmFy)
decode Zg== -> f (want: f)
decode Zm8= -> fo (want: fo)
decode Zm9v -> foo (want: foo)
decode Zm9vYg== -> foob (want: foob)
decode Zm9vYmE= -> fooba (want: fooba)
decode Zm9vYmFy -> foobar (want: foobar)
roundtrip MATCH: The quick brown fox jumps over the lazy dog.

Flows

flow ~new click a branch to expand · @labels scroll to their anchor
new (out, capacity: 2, source: enc: *std/string:String<std/string:instance!>, dec: *std/string:String<std/string:instance!>)
subflow ~emit.enc click a branch to expand · @labels scroll to their anchor
query (out)
subflow ~emit.dec click a branch to expand · @labels scroll to their anchor
query (out)
subflow ~quad.char click a branch to expand · @labels scroll to their anchor
if (i > n)
subflow ~emit.quad click a branch to expand · @labels scroll to their anchor
quad.char (w, n, i: 0)
subflow ~encode click a branch to expand · @labels scroll to their anchor
capture (source: acc: 0[i64], n: 0[i64])
subflow ~un.sextet click a branch to expand · @labels scroll to their anchor
if (ch >= 65 and ch <= 90)
subflow ~decode click a branch to expand · @labels scroll to their anchor
capture (source: acc: 0[i64], bits: 0[i64])
subflow ~text.len click a branch to expand · @labels scroll to their anchor
capture (source: n: 0[i64])
flow ~from-page click a branch to expand · @labels scroll to their anchor
from-page (text: "")
subflow ~check.encode click a branch to expand · @labels scroll to their anchor
query (out)
subflow ~check.decode click a branch to expand · @labels scroll to their anchor
query (out)
flow ~check.encode click a branch to expand · @labels scroll to their anchor
check.encode (text: "", want: "")
flow ~check.encode click a branch to expand · @labels scroll to their anchor
check.encode (text: "f", want: "Zg==")
flow ~check.encode click a branch to expand · @labels scroll to their anchor
check.encode (text: "fo", want: "Zm8=")
flow ~check.encode click a branch to expand · @labels scroll to their anchor
check.encode (text: "foo", want: "Zm9v")
flow ~check.encode click a branch to expand · @labels scroll to their anchor
check.encode (text: "foob", want: "Zm9vYg==")
flow ~check.encode click a branch to expand · @labels scroll to their anchor
check.encode (text: "fooba", want: "Zm9vYmE=")
flow ~check.encode click a branch to expand · @labels scroll to their anchor
check.encode (text: "foobar", want: "Zm9vYmFy")
flow ~check.decode click a branch to expand · @labels scroll to their anchor
check.decode (text: "Zg==", want: "f")
flow ~check.decode click a branch to expand · @labels scroll to their anchor
check.decode (text: "Zm8=", want: "fo")
flow ~check.decode click a branch to expand · @labels scroll to their anchor
check.decode (text: "Zm9v", want: "foo")
flow ~check.decode click a branch to expand · @labels scroll to their anchor
check.decode (text: "Zm9vYg==", want: "foob")
flow ~check.decode click a branch to expand · @labels scroll to their anchor
check.decode (text: "Zm9vYmE=", want: "fooba")
flow ~check.decode click a branch to expand · @labels scroll to their anchor
check.decode (text: "Zm9vYmFy", want: "foobar")
flow ~query click a branch to expand · @labels scroll to their anchor
query (out)

Test Configuration

MUST_RUN