[][src]Struct harsh::Harsh

pub struct Harsh { /* fields omitted */ }

A hashids-compatible hasher.

It's probably not a great idea to use the default, because in that case your values will be entirely trivial to decode. On the other hand, this is not intended to be cryptographically-secure, so go nuts!

Methods

impl Harsh[src]

pub fn encode(&self, values: &[u64]) -> Option<String>[src]

Encodes a slice of u64 values into a single hashid.

pub fn decode<T: AsRef<str>>(&self, value: T) -> Option<Vec<u64>>[src]

Decodes a single hashid into a slice of u64 values.

pub fn encode_hex(&self, hex: &str) -> Option<String>[src]

Encodes a hex string into a hashid.

pub fn decode_hex(&self, value: &str) -> Option<String>[src]

Decodes a hashid into a hex string.

Trait Implementations

impl Default for Harsh[src]

impl Clone for Harsh[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Harsh[src]

Auto Trait Implementations

impl Send for Harsh

impl Sync for Harsh

Blanket Implementations

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

impl<T> From for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

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> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut 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.