yabase/facade
Values
pub fn decode_adobe_ascii85(
input: String,
) -> Result(BitArray, error.CodecError)
Decode an Adobe Ascii85 string (with <~ ~> delimiters) to a BitArray.
pub fn decode_ascii85(
input: String,
) -> Result(BitArray, error.CodecError)
Decode an Ascii85 string to a BitArray.
pub fn decode_base10(
input: String,
) -> Result(BitArray, error.CodecError)
Decode a decimal string to a BitArray.
pub fn decode_base16(
input: String,
) -> Result(BitArray, error.CodecError)
Decode a hexadecimal string to a BitArray. Case-insensitive.
pub fn decode_base2(
input: String,
) -> Result(BitArray, error.CodecError)
Decode a binary string to a BitArray. Length must be a multiple of 8.
pub fn decode_base32(
input: String,
) -> Result(BitArray, error.CodecError)
Decode a Base32 (RFC 4648) string to a BitArray.
pub fn decode_base32_clockwork(
input: String,
) -> Result(BitArray, error.CodecError)
Decode a Clockwork Base32 string. O->0, I/L->1, case-insensitive.
pub fn decode_base32_crockford(
input: String,
) -> Result(BitArray, error.CodecError)
Decode a Crockford’s Base32 string. O->0, I/L->1, hyphens ignored.
pub fn decode_base32_crockford_check(
input: String,
) -> Result(BitArray, error.CodecError)
Decode a Crockford’s Base32 string with check symbol verification.
pub fn decode_base32_hex(
input: String,
) -> Result(BitArray, error.CodecError)
Decode a Base32 Hex string to a BitArray.
pub fn decode_base32_strict(
input: String,
) -> Result(BitArray, error.CodecError)
Decode a Base32 (RFC 4648) string and additionally reject
non-canonical encodings per §3.5 — the trailing pad bits in a
final block of fewer than 5 bytes must be zero. Returns
Error(NonCanonical) for inputs whose pad bits are set. See
yabase/base32/rfc4648.decode_strict for the full contract.
pub fn decode_base36(
input: String,
) -> Result(BitArray, error.CodecError)
Decode a Base36 string to a BitArray. Case-insensitive.
pub fn decode_base45(
input: String,
) -> Result(BitArray, error.CodecError)
Decode a Base45 string to a BitArray.
pub fn decode_base58(
input: String,
) -> Result(BitArray, error.CodecError)
Decode a Base58 (Bitcoin) string to a BitArray. Leading ‘1’ characters become zero bytes.
pub fn decode_base58_flickr(
input: String,
) -> Result(BitArray, error.CodecError)
Decode a Base58 (Flickr) string to a BitArray.
pub fn decode_base62(
input: String,
) -> Result(BitArray, error.CodecError)
Decode a Base62 string to a BitArray.
pub fn decode_base64(
input: String,
) -> Result(BitArray, error.CodecError)
Decode a standard Base64 string to a BitArray.
pub fn decode_base64_dq(
input: String,
) -> Result(BitArray, error.CodecError)
Decode a Base64 DQ (hiragana) string to a BitArray.
pub fn decode_base64_nopadding(
input: String,
) -> Result(BitArray, error.CodecError)
Decode a Base64 string without padding to a BitArray.
pub fn decode_base64_strict(
input: String,
) -> Result(BitArray, error.CodecError)
Decode a standard Base64 string and additionally reject
non-canonical encodings per RFC 4648 §3.5 — the trailing pad
bits in a 1- or 2-byte final block must be zero. Returns
Error(NonCanonical) for inputs whose pad bits are set. See
yabase/base64/standard.decode_strict for the full contract.
pub fn decode_base64_urlsafe(
input: String,
) -> Result(BitArray, error.CodecError)
Decode a URL-safe Base64 string to a BitArray.
pub fn decode_base64_urlsafe_nopadding(
input: String,
) -> Result(BitArray, error.CodecError)
Decode a URL-safe Base64 string without padding to a BitArray.
pub fn decode_base8(
input: String,
) -> Result(BitArray, error.CodecError)
Decode an octal string to a BitArray.
pub fn decode_base91(
input: String,
) -> Result(BitArray, error.CodecError)
Decode a Base91 string to a BitArray.
pub fn decode_rfc1924_base85(
input: String,
) -> Result(BitArray, error.CodecError)
Decode an RFC 1924 Base85 string to a BitArray. Input length must be a multiple of 5.
pub fn decode_z85(
input: String,
) -> Result(BitArray, error.CodecError)
Decode a Z85 string to a BitArray. Input length must be a multiple of 5.
pub fn decode_zbase32(
input: String,
) -> Result(BitArray, error.CodecError)
Decode a z-base-32 string to a BitArray.
pub fn encode_adobe_ascii85(data: BitArray) -> String
Encode a BitArray to Adobe Ascii85 with <~ ~> delimiters.
pub fn encode_ascii85(data: BitArray) -> String
Encode a BitArray to Ascii85 (btoa style).
pub fn encode_base10(data: BitArray) -> String
Encode a BitArray to a decimal string.
pub fn encode_base16(data: BitArray) -> String
Encode a BitArray to an uppercase hexadecimal string per RFC 4648
§8 (canonical Base 16). Use encode_base16_lowercase for the
non-canonical lowercase variant. The decoder remains
case-insensitive — see decode_base16. (Issue #19)
pub fn encode_base16_lowercase(data: BitArray) -> String
Encode a BitArray to a lowercase hexadecimal string. Use when
interoperating with sha256sum-style tools or the IPFS multibase
prefix f; the canonical RFC 4648 §8 form is uppercase, served
by encode_base16.
pub fn encode_base2(data: BitArray) -> String
Encode a BitArray to a binary string (each byte as 8 chars of 0/1).
pub fn encode_base32(data: BitArray) -> String
Encode a BitArray to Base32 (RFC 4648) with padding.
pub fn encode_base32_clockwork(data: BitArray) -> String
Encode a BitArray to Clockwork Base32. No padding, no confusable characters.
pub fn encode_base32_crockford(data: BitArray) -> String
Encode a BitArray to Crockford’s Base32. No padding. Hyphens ignored on decode.
pub fn encode_base32_crockford_check(data: BitArray) -> String
Encode a BitArray to Crockford’s Base32 with a check symbol appended.
pub fn encode_base32_hex(data: BitArray) -> String
Encode a BitArray to Base32 Hex (extended hex alphabet, RFC 4648) with padding.
pub fn encode_base36(data: BitArray) -> String
Encode a BitArray to Base36 (0-9, a-z). Returns “” for empty input.
pub fn encode_base45(data: BitArray) -> String
Encode a BitArray to Base45 (RFC 9285, QR-code friendly).
pub fn encode_base58(data: BitArray) -> String
Encode a BitArray to Base58 (Bitcoin alphabet). Leading zero bytes become ‘1’.
pub fn encode_base58_flickr(data: BitArray) -> String
Encode a BitArray to Base58 (Flickr alphabet). Same as Bitcoin but with swapped case.
pub fn encode_base62(data: BitArray) -> String
Encode a BitArray to Base62 (0-9, A-Z, a-z). Returns “” for empty input.
pub fn encode_base64(data: BitArray) -> String
Encode a BitArray to standard Base64 (RFC 4648) with padding.
pub fn encode_base64_dq(data: BitArray) -> String
Encode a BitArray to Base64 DQ (Dragon Quest revival password style, hiragana alphabet).
pub fn encode_base64_nopadding(data: BitArray) -> String
Encode a BitArray to Base64 without padding characters.
pub fn encode_base64_urlsafe(data: BitArray) -> String
Encode a BitArray to URL-safe Base64 (- instead of +, _ instead of /) with padding.
pub fn encode_base64_urlsafe_nopadding(data: BitArray) -> String
Encode a BitArray to URL-safe Base64 without padding.
pub fn encode_base8(data: BitArray) -> String
Encode a BitArray to an octal string.
pub fn encode_base91(data: BitArray) -> String
Encode a BitArray to Base91 (91 printable ASCII characters).
pub fn encode_rfc1924_base85(
data: BitArray,
) -> Result(String, error.CodecError)
Encode a BitArray to RFC 1924 Base85.
Returns Error(InvalidLength) if input length is not a multiple of 4 bytes.
pub fn encode_z85(
data: BitArray,
) -> Result(String, error.CodecError)
Encode a BitArray to Z85 (ZeroMQ variant of Base85).
Returns Error(InvalidLength) if input length is not a multiple of 4 bytes.
pub fn encode_zbase32(data: BitArray) -> String
Encode a BitArray to z-base-32 (human-oriented, no padding).