pub struct Config {
    pub salt: String,
}
Expand description

Configuration for generting proof of work Please choose a long, unique value for salt Resistance to dictionary/rainbow attacks depend on uniqueness of the salt

Fields

salt: String

Implementations

Create Proof of Work over item of type T.

Make sure difficulty is not too high. A 64 bit difficulty, for example, takes a long time on a general purpose processor. Returns bincode::Error if serialization fails.

Create Proof of Work on an already serialized item of type T. The input is assumed to be serialized using network byte order.

Make sure difficulty is not too high. A 64 bit difficulty, for example, takes a long time on a general purpose processor.

Calculate the PoW score with the provided input T.

Calculate the PoW score of an already serialized T and self. The input is assumed to be serialized using network byte order.

Verifies that the PoW is indeed generated out of the phrase provided.

Checks if the PoW result is of sufficient difficulty

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

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

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The resulting type after obtaining ownership.

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

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

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.