Struct exonum::crypto::Hash [] [src]

pub struct Hash(_);

SHA256 hash.

Default implementation for the Hash returns hash consisting of zeros.

Examples

use exonum::crypto::{self, Hash};

let data = [1, 2, 3];
let hash_from_data = crypto::hash(&data);
let default_hash = Hash::default();

Methods

impl Hash
[src]

Creates a new instance filled with zeros.

impl Hash
[src]

Creates a new instance from bytes array.

Creates a new instance from bytes slice.

Trait Implementations

impl<'a> ExonumJson for &'a Hash
[src]

write deserialized field in buffer on place.

serialize field as json::Value

impl ExonumJsonDeserialize for Hash
[src]

deserialize json value.

impl<'a> Field<'a> for &'a Hash
[src]

Field's header size

Read Field from buffer, with given position, beware of memory unsafety, you should check Field before read. Read more

Write Field to buffer, in given position write doesn't lead to memory unsafety. Read more

Checks if data in the buffer could be deserialized. Returns an index of latest data seen. Read more

impl PartialEq for Hash
[src]

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

This method tests for !=.

impl Eq for Hash
[src]

impl Clone for Hash
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for Hash
[src]

impl PartialOrd for Hash
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Ord for Hash
[src]

This method returns an Ordering between self and other. Read more

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

Compares and returns the maximum of two values. Read more

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

Compares and returns the minimum of two values. Read more

impl Hash for Hash
[src]

Feeds this value into the given [Hasher]. Read more

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

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

Performs the conversion.

impl Debug for Hash
[src]

Formats the value using the given formatter.

impl HexValue for Hash
[src]

Format value as hex representation.

Convert value from hex representation.

impl Serialize for Hash
[src]

Serialize this value into the given Serde serializer. Read more

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

Deserialize this value from the given Serde deserializer. Read more

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

The returned type after indexing

The method for the indexing (container[index]) operation

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

The returned type after indexing

The method for the indexing (container[index]) operation

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

The returned type after indexing

The method for the indexing (container[index]) operation

impl Index<RangeFull> for Hash
[src]

The returned type after indexing

The method for the indexing (container[index]) operation

impl Default for Hash
[src]

Returns the "default value" for a type. Read more

impl StorageKey for Hash
[src]

Returns the size of the serialized key in bytes.

Serialize a key into the specified buffer of bytes. Read more

Deserialize a key from the specified buffer of bytes.

impl StorageValue for Hash
[src]

Serialize a value into a vector of bytes.

Deserialize a value from bytes.

Returns a hash of the value. Read more

impl ProofMapKey for Hash
[src]