[][src]Struct harsh::HarshBuilder

pub struct HarshBuilder { /* fields omitted */ }

A builder used to configure and create a Harsh instance.

Methods

impl HarshBuilder[src]

pub fn new() -> HarshBuilder[src]

Creates a new HarshBuilder instance.

pub fn salt<T: Into<Vec<u8>>>(self, salt: T) -> HarshBuilder[src]

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.

pub fn alphabet<T: Into<Vec<u8>>>(self, alphabet: T) -> HarshBuilder[src]

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.

pub fn separators<T: Into<Vec<u8>>>(self, separators: T) -> HarshBuilder[src]

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.

pub fn length(self, hash_length: usize) -> HarshBuilder[src]

Provides a minimum hash length.

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

pub fn init(self) -> Result<Harsh>[src]

Initializes a new Harsh based on the HarshBuilder.

This method will consume the HarshBuilder.

Trait Implementations

impl Default for HarshBuilder[src]

impl Debug for HarshBuilder[src]

Auto Trait Implementations

Blanket Implementations

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

impl<T> From for T[src]

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

type Error = !

🔬 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, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 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> BorrowMut for T where
    T: ?Sized
[src]