Struct harsh::HarshFactory [] [src]

pub struct HarshFactory {
    // some fields omitted
}

Factory used to create a new Harsh instance.

Note that this factory will be consumed upon initialization.

Methods

impl HarshFactory
[src]

fn new() -> HarshFactory

Creates a new HarshFactory instance.

fn salt<T: Into<Vec<u8>>>(self, salt: T) -> HarshFactory

Provides a salt.

Note that this salt will be converted into a [u8] before use, meaning that multi-byte utf8 character values should be avoided.

fn alphabet<T: Into<Vec<u8>>>(self, alphabet: T) -> HarshFactory

Provides an alphabet.

Note that this alphabet will be converted into a [u8] before use, meaning that multi-byte utf8 character values should be avoided.

fn separators<T: Into<Vec<u8>>>(self, separators: T) -> HarshFactory

Provides a set of separators.

Note that these separators will be converted into a [u8] before use, meaning that multi-byte utf8 character values should be avoided.

fn length(self, hash_length: usize) -> HarshFactory

Provides a minimum hash length.

Keep in mind that hashes produced may be longer than this length.

fn init(self) -> Result<Harsh>

Initializes a new Harsh based on the HarshFactory.

This method will consume the HarshFactory.

Trait Implementations

impl Default for HarshFactory
[src]

fn default() -> HarshFactory

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

impl Debug for HarshFactory
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.