1 #ifndef IPFS_MB_PREFIXES_H_
2 #define IPFS_MB_PREFIXES_H_
4 #include <vocab/byte_view.h>
14 enum class Code : char {
26 Code CodeFromPrefix(
char c);
27 std::string_view GetName(Code);
29 using Decoder = std::vector<Byte> (*)(std::string_view);
30 using Encoder = std::string (*)(ByteView);
44 std::string_view
const name;
51 std::string encode(Code, ByteView);
52 std::optional<std::vector<Byte>> decode(std::string_view mb_str);
Definition: multi_base.h:34
Encoder const encode
Definition: multi_base.h:40
static Codec const * Get(Code code)
Definition: multi_base.cc:63
std::string_view const name
Definition: multi_base.h:44
Decoder const decode
Definition: multi_base.h:37