Enum HashAlgorithm

Source
pub enum HashAlgorithm {
    Md4,
    HmacMd4,
    Md5,
    Md5Version06,
    HmacMd5,
    HmacMd5Version06,
    Sha1,
    HmacSha1,
    Sha256,
    HmacSha256,
    Ripemd160,
    HmacRipemd160,
}
Expand description

The hash algorithm to use, as shown in the GUI of the JavaScript edition of PasswordMaker Pro.

§Description

Most algorithms work by computing the hash of the input values and doing a number system base conversion to indices into the supplied character array. Notable exceptions are the HMAC algorithms, which not only compute the HMAC for the input, but also, before that, encode the input as UTF-16 and discard all upper bytes. The Md5Version06 variant is for compatibility with ancient versions of PasswordMaker Pro. Not only does it also do the conversion to UTF-16 and the discarding of the upper bytes, in addition it disregards the user-supplied character set completely, and instead just outputs the hash encoded as hexadecimal numbers. The HmacMd5Version06 is similarly ignoring the supplied characters and using hexadecimal numbers as output.

Variants§

§

Md4

Regular Md4 PasswordMaker Pro setting.

§

HmacMd4

HAMC Md4 PasswordMaker Pro setting. Encodes input as UTF-16 and discards upper byte (just as PasswordMaker Pro does for HMAC).

§

Md5

Regular Md5 PasswordMaker Pro setting.

§

Md5Version06

Md5 as computed by PasswordMaker Pro version 0.6. Encodes input as UTF-16 and discards upper byte and outputs MD5 as hex number.

§

HmacMd5

HMAC Md5 PasswordMaker Pro setting. Encodes input as UTF-16 and discards upper byte (just as PasswordMaker Pro does for HMAC).

§

HmacMd5Version06

HMAC Md5 as computed by PasswordMaker Pro version 0.6. Encodes input as UTF-16 and discards upper byte and outputs MD5 as hex number.

§

Sha1

Regular Sha1 PasswordMaker Pro setting.

§

HmacSha1

HAMC Sha1 PasswordMaker Pro setting. Encodes input as UTF-16 and discards upper byte (just as PasswordMaker Pro does for HMAC).

§

Sha256

Regular Sha256 PasswordMaker Pro setting.

§

HmacSha256

HAMC Sha256 PasswordMaker Pro setting. Encodes input as UTF-16 and discards upper byte (just as PasswordMaker Pro does for HMAC).

§

Ripemd160

Regular Ripemd160 PasswordMaker Pro setting.

§

HmacRipemd160

HAMC Ripemd160 PasswordMaker Pro setting. Encodes input as UTF-16 and discards upper byte (just as PasswordMaker Pro does for HMAC).

Trait Implementations§

Source§

impl Clone for HashAlgorithm

Source§

fn clone(&self) -> HashAlgorithm

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for HashAlgorithm

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for HashAlgorithm

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.