yabase
Values
pub fn decode(
enc: encoding.Encoding,
value: String,
) -> Result(BitArray, error.CodecError)
Decode a string using the specified encoding.
pub fn decode_multibase(
value: String,
) -> Result(encoding.Decoded, error.CodecError)
Decode a multibase-prefixed string, auto-detecting encoding.
Inspect the result with encoding.decoded_encoding/1 and
encoding.decoded_data/1 — the Decoded type is opaque so its
representation can evolve without breaking external pattern matches.
pub fn encode(
enc: encoding.Encoding,
data: BitArray,
) -> Result(String, error.CodecError)
Encode data using the specified encoding. Returns Result because some encodings (Base85 Z85/Rfc1924) have input length constraints.
pub fn encode_multibase(
enc: encoding.Encoding,
data: BitArray,
) -> Result(String, error.CodecError)
Encode with a multibase prefix. Returns Error for encodings without a defined prefix.