1#ifndef IPFS_MB_PREFIXES_H_
2#define IPFS_MB_PREFIXES_H_
4#include <vocab/byte_view.h>
14enum class Code :
char {
26Code CodeFromPrefix(
char c);
27std::string_view GetName(Code);
29using Decoder = std::vector<Byte> (*)(std::string_view);
30using Encoder = std::string (*)(ByteView);
44 std::string_view
const name;
51std::string encode(Code, ByteView);
52std::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