yabase/core/multibase

Values

pub fn decode(
  value: String,
) -> Result(encoding.Decoded, encoding.CodecError)

Decode a multibase-prefixed string, auto-detecting the encoding. Returns Decoded(encoding, data) where data is the decoded BitArray.

pub fn decode_bytes(
  value: String,
) -> Result(BitArray, encoding.CodecError)

Decode a multibase-prefixed string to raw bytes.

pub fn encode_with_prefix(
  enc: encoding.Encoding,
  data: BitArray,
) -> Result(String, encoding.CodecError)

Encode data with a multibase prefix. Only encodings with an official multibase code point are supported. Returns Error(UnsupportedMultibaseEncoding) otherwise.

Search Document