+ return generic_to_base64(s, ns, mime_base64_table);
+}
+
+/** @brief Convert a binary string to base64
+ * @param s Bytes to convert
+ * @param ns Number of bytes to convert
+ * @param table Table of characters to use
+ * @return Encoded data
+ *
+ * This function does not attempt to split up lines.
+ *
+ * @p table should consist of 65 characters. The first 64 will be used to
+ * represents the 64 digits and the 65th will be used as padding at the end
+ * (i.e. the role of '=' in RFC2045 base64).
+ */
+char *generic_to_base64(const uint8_t *s, size_t ns, const char *table) {