The result of applying the SHA-256 hash function to data.
This function splits the input data into blocks and runs each block
through a cycle of 64 iterations. The result of the function is a hash
256 bits or 32 bytes in length.
The example below generates the hash of the indicated data.
use exonum::crypto::{self, Hash};
let data = [1, 2, 3];
let hash_from_data = crypto::hash(&data);
let default_hash = Hash::default();
Creates a new instance filled with zeros.
Creates a new instance from bytes array.
Creates a new instance from bytes slice.
Returns a hex representation of binary data.
Lower case letters are used (e.g. f9b4ca).
write deserialized field in buffer on place.
serialize field as json::Value
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. Default implementation simply checks that the length of segment equals field size. Read more
Returns the size of the serialized key in bytes.
Serializes the key into the specified buffer of bytes. Read more
Deserializes the key from the specified buffer of bytes.
Serialize a value into a vector of bytes.
Deserialize a value from bytes.
The type of keys as read from the database. Read more
Writes this key into a byte buffer. Read more
Reads this key from the buffer.
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
Returns a hash consisting of zeros.
Returns the "default value" for a type. Read more
This method tests for self
and other
values to be equal, and is used by ==
. Read more
This method tests for !=
.
Performs copy-assignment from source
. Read more
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self | 1.21.0 [src] |
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self | 1.21.0 [src] |
Compares and returns the minimum of two values. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
Feeds this value into the given [Hasher
]. Read more
Feeds a slice of this type into the given [Hasher
]. Read more
The returned type after indexing.
Performs the indexing (container[index]
) operation.
The returned type after indexing.
Performs the indexing (container[index]
) operation.
The returned type after indexing.
Performs the indexing (container[index]
) operation.
The returned type after indexing.
Performs the indexing (container[index]
) operation.
Deserialize this value from the given Serde deserializer. Read more
Serialize this value into the given Serde serializer. Read more
Creates an instance of type Self
from the given hex string, or fails with a custom error type. Read more
Serializes content of a transaction with the given serializer.
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String
. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Compare self to key
and return true
if they are equal.
Writes the hex string representing self
into w
. Lower case letters are used (e.g. f9b4ca
). Read more
Writes the hex string representing self
into w
. Upper case letters are used (e.g. F9B4CA
). Read more
impl<T> Clear for T where T: InitializableFromZeroed + ?Sized, | |
Completely overwrites this value.
impl<T> InitializableFromZeroed for T where T: Default, | |
Called to initialize a place to a valid value, after it is set to all-bits-zero. Read more