+static void do_base64(void *ctx, char *p, size_t sz, dstr *d)
+ { base64_encode(ctx, p, sz, d); }
+static void do_format_base64(size_t n, unsigned line,
+ void (*fix)(char *, size_t))
+{
+ base64_ctx b;
+
+ base64_init(&b);
+ if (line) { b.indent = "\n"; b.maxline = line; }
+ else { b.indent = ""; b.maxline = 0; }
+ do_format(n, line, &b, do_base64, fix);
+}
+static void format_base64(size_t n, unsigned line)
+ { do_format_base64(n, line, 0); }
+
+static void do_base32(void *ctx, char *p, size_t sz, dstr *d)
+ { base32_encode(ctx, p, sz, d); }
+static void format_base32(size_t n, unsigned line)
+{
+ base32_ctx b;
+
+ base32_init(&b);
+ if (line) { b.indent = "\n"; b.maxline = line; }
+ else { b.indent = ""; b.maxline = 0; }
+ do_format(n, line, &b, do_base32, 0);
+}
+
+static void fix_file64(char *p, size_t n)