[−][src]Struct harsh::Harsh
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(&self) -> 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
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,