[][src]Struct fog_pack::crypto::Hash

pub struct Hash { /* fields omitted */ }

Crytographically secure hash of data. Can be signed by a FullKey. It is impractical to generate an identical hash from different data.

Supported Versions

  • 0: Null hash. Used to refer to hash of parent document
  • 1: Blake2B hash with 32 bytes of digest

Implementations

impl Hash[src]

pub fn new(data: &[u8]) -> Hash[src]

pub fn with_version(version: u8, data: &[u8]) -> Result<Hash, CryptoError>[src]

pub fn new_empty() -> Hash[src]

pub fn version(&self) -> u8[src]

pub fn digest(&self) -> &[u8][src]

pub fn len(&self) -> usize[src]

pub fn encode(&self, buf: &mut Vec<u8>)[src]

pub fn decode(buf: &mut &[u8]) -> Result<Hash, CryptoError>[src]

pub fn encode_base58(&self) -> String[src]

pub fn decode_base58(s: &str) -> Result<Hash, CryptoError>[src]

Trait Implementations

impl Clone for Hash[src]

impl Debug for Hash[src]

impl Display for Hash[src]

impl Eq for Hash[src]

impl From<Hash> for Value[src]

impl Hash for Hash[src]

impl LowerHex for Hash[src]

impl Ord for Hash[src]

impl PartialEq<Hash> for Hash[src]

impl PartialOrd<Hash> for Hash[src]

impl UpperHex for Hash[src]

Auto Trait Implementations

impl RefUnwindSafe for Hash

impl Send for Hash

impl Sync for Hash

impl Unpin for Hash

impl UnwindSafe for Hash

Blanket Implementations

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

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

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

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

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

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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.

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.