Enum libipld::cid::multibase::Base[]

pub enum Base {
Show variants Identity, Base2, Base8, Base10, Base16Lower, Base16Upper, Base32Lower, Base32Upper, Base32PadLower, Base32PadUpper, Base32HexLower, Base32HexUpper, Base32HexPadLower, Base32HexPadUpper, Base32Z, Base36Lower, Base36Upper, Base58Flickr, Base58Btc, Base64, Base64Pad, Base64Url, Base64UrlPad,
}
Expand description

List of types currently supported in the multibase spec.

Not all base types are supported by this library.

Variants

Identity

8-bit binary (encoder and decoder keeps data unmodified).

Base2

Base2 (alphabet: 01).

Base8

Base8 (alphabet: 01234567).

Base10

Base10 (alphabet: 0123456789).

Base16Lower

Base16 lower hexadecimal (alphabet: 0123456789abcdef).

Base16Upper

Base16 upper hexadecimal (alphabet: 0123456789ABCDEF).

Base32Lower

Base32, rfc4648 no padding (alphabet: abcdefghijklmnopqrstuvwxyz234567).

Base32Upper

Base32, rfc4648 no padding (alphabet: ABCDEFGHIJKLMNOPQRSTUVWXYZ234567).

Base32PadLower

Base32, rfc4648 with padding (alphabet: abcdefghijklmnopqrstuvwxyz234567).

Base32PadUpper

Base32, rfc4648 with padding (alphabet: ABCDEFGHIJKLMNOPQRSTUVWXYZ234567).

Base32HexLower

Base32hex, rfc4648 no padding (alphabet: 0123456789abcdefghijklmnopqrstuv).

Base32HexUpper

Base32hex, rfc4648 no padding (alphabet: 0123456789ABCDEFGHIJKLMNOPQRSTUV).

Base32HexPadLower

Base32hex, rfc4648 with padding (alphabet: 0123456789abcdefghijklmnopqrstuv).

Base32HexPadUpper

Base32hex, rfc4648 with padding (alphabet: 0123456789ABCDEFGHIJKLMNOPQRSTUV).

Base32Z

z-base-32 (used by Tahoe-LAFS) (alphabet: ybndrfg8ejkmcpqxot1uwisza345h769).

Base36Lower

Base36, [0-9a-z] no padding (alphabet: 0123456789abcdefghijklmnopqrstuvwxyz).

Base36Upper

Base36, [0-9A-Z] no padding (alphabet: 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ).

Base58Flickr

Base58 flicker (alphabet: 123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ).

Base58Btc

Base58 bitcoin (alphabet: 123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz).

Base64

Base64, rfc4648 no padding (alphabet: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/).

Base64Pad

Base64, rfc4648 with padding (alphabet: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/).

Base64Url

Base64 url, rfc4648 no padding (alphabet: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_).

Base64UrlPad

Base64 url, rfc4648 with padding (alphabet: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_).

Implementations

impl Base

pub fn from_code(code: char) -> Result<Base, Error>

Convert a number to the matching base algorithm, or Error if no algorithm is matching.

pub fn code(&self) -> char

Get the code corresponding to the base algorithm.

pub fn encode<I>(&self, input: I) -> String where
    I: AsRef<[u8]>, 

Encode the given byte slice to base string.

pub fn decode<I>(&self, input: I) -> Result<Vec<u8, Global>, Error> where
    I: AsRef<str>, 

Decode the base string.

Trait Implementations

impl Clone for Base

pub fn clone(&self) -> Base

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Base

pub fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

impl PartialEq<Base> for Base

pub fn eq(&self, other: &Base) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl Copy for Base

impl Eq for Base

impl StructuralEq for Base

impl StructuralPartialEq for Base

Auto Trait Implementations

impl RefUnwindSafe for Base

impl Send for Base

impl Sync for Base

impl Unpin for Base

impl UnwindSafe for Base

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> References<RawCodec> for T[src]

pub fn references<R, E>(
    _c: RawCodec,
    _r: &mut R,
    _set: &mut E
) -> Result<(), Error> where
    E: Extend<Cid<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>>,
    R: Read
[src]

Scrape the references from an impl Read. Read more

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.