[][src]Struct grin_core::core::hash::Hash

pub struct Hash(_);

A hash to uniquely (or close enough) identify one of the main blockchain constructs. Used pervasively for blocks, transactions and outputs.

Methods

impl Hash
[src]

Builds a Hash from a byte vector. If the vector is too short, it will be completed by zeroes. If it's too long, it will be truncated.

Converts the hash to a byte vector

Returns a byte slice of the hash contents.

Convert a hash to hex string format.

Convert hex string back to hash.

Most significant 64 bits

Trait Implementations

impl Writeable for Hash
[src]

impl Readable for Hash
[src]

impl FixedLength for Hash
[src]

Size of a hash in bytes.

impl AsFixedBytes for Hash
[src]

impl Ord for Hash
[src]

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

impl PartialEq<Hash> for Hash
[src]

impl Clone for Hash
[src]

Performs copy-assignment from source. Read more

impl Copy for Hash
[src]

impl Eq for Hash
[src]

impl PartialOrd<Hash> for Hash
[src]

impl AsRef<[u8]> for Hash
[src]

impl Default for Hash
[src]

impl Display for Hash
[src]

impl Debug for Hash
[src]

impl Add<Hash> for Hash
[src]

The resulting type after applying the + operator.

impl Index<usize> for Hash
[src]

The returned type after indexing.

impl Index<Range<usize>> for Hash
[src]

The returned type after indexing.

impl Index<RangeTo<usize>> for Hash
[src]

The returned type after indexing.

impl Index<RangeFrom<usize>> for Hash
[src]

The returned type after indexing.

impl Index<RangeFull> for Hash
[src]

The returned type after indexing.

impl Hash for Hash
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Serialize for Hash
[src]

impl<'de> Deserialize<'de> for Hash
[src]

Auto Trait Implementations

impl Send for Hash

impl Sync for Hash

Blanket Implementations

impl<W> Hashed for W where
    W: Writeable
[src]

impl<H> ShortIdentifiable for H where
    H: Hashed
[src]

Generate a short_id via the following -

  • extract k0/k1 from block_hash hashed with the nonce (first two u64 values) * initialize a siphasher24 with k0/k1
    • self.hash() passing in the siphasher24 instance
    • drop the 2 most significant bytes (to return a 6 byte short_id)

impl<T> PMMRIndexHashable for T where
    T: Writeable
[src]

impl<T> From for T
[src]

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

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

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

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

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

The type returned in the event of a conversion error.

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

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

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

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

The type returned in the event of a conversion error.

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

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> DebugAny for T where
    T: Any + Debug

impl<T> CloneAny for T where
    T: Clone + Any

impl<T> UnsafeAny for T where
    T: Any

impl<T> Erased for T

impl<T> Same for T

Should always be Self